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

(-)a/C4/Biblio.pm (+6 lines)
Lines 1862-1870 sub GetMarcAuthors { Link Here
1862
        }
1862
        }
1863
1863
1864
        # other subfields
1864
        # other subfields
1865
        my $unimarc3;
1865
        for my $authors_subfield (@subfields) {
1866
        for my $authors_subfield (@subfields) {
1866
            next if ( $authors_subfield->[0] eq '9' );
1867
            next if ( $authors_subfield->[0] eq '9' );
1867
1868
1869
            # unimarc3 contains the $3 of the author for UNIMARC.
1870
            # For french academic libraries, it's the "ppn", and it's required for idref webservice
1871
            $unimarc3 = $authors_subfield->[1] if $marcflavour eq 'UNIMARC' and $authors_subfield->[0] =~ /3/;
1872
1868
            # don't load unimarc subfields 3, 5
1873
            # don't load unimarc subfields 3, 5
1869
            next if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /3|5/ ) );
1874
            next if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /3|5/ ) );
1870
1875
Lines 1900-1905 sub GetMarcAuthors { Link Here
1900
        push @marcauthors, {
1905
        push @marcauthors, {
1901
            MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop,
1906
            MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop,
1902
            authoritylink => $subfield9,
1907
            authoritylink => $subfield9,
1908
            unimarc3 => $unimarc3
1903
        };
1909
        };
1904
    }
1910
    }
1905
    return \@marcauthors;
1911
    return \@marcauthors;
(-)a/etc/zebradb/marc_defs/unimarc/biblios/record.abs (+7 lines)
Lines 134-147 melm 701 Author,Personal-name,Author:p,Personal-name:p,Personal-name:p Link Here
134
melm 702$9      Koha-Auth-Number,Koha-Auth-Number:n
134
melm 702$9      Koha-Auth-Number,Koha-Auth-Number:n
135
melm 702        Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
135
melm 702        Author,Personal-name,Author:p,Personal-name:p,Personal-name:p
136
136
137
melm 700$3      Identified-standard
138
melm 701$3      Identified-standard
139
melm 702$3      Identified-standard
140
137
# collective Author
141
# collective Author
138
melm 710$9        Koha-Auth-Number,Koha-Auth-Number:n
142
melm 710$9        Koha-Auth-Number,Koha-Auth-Number:n
139
melm 710    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
143
melm 710    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
144
melm 710$3      Identified-standard
140
melm 711$9        Koha-Auth-Number,Koha-Auth-Number:n
145
melm 711$9        Koha-Auth-Number,Koha-Auth-Number:n
141
melm 711    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
146
melm 711    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
147
melm 711$3      Identified-standard
142
148
143
melm 712$9        Koha-Auth-Number,Koha-Auth-Number:n
149
melm 712$9        Koha-Auth-Number,Koha-Auth-Number:n
144
melm 712    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
150
melm 712    Author,Author-name-corporate,Author-name-conference,Corporate-name,Conference-name,Author:p,Author-name-corporate:p,Author-name-conference:p,Corporate-name:p,Conference-name:p
151
melm 712$3      Identified-standard
145
152
146
# trademark Author : 716
153
# trademark Author : 716
147
melm 716$9        Koha-Auth-Number,Koha-Auth-Number:n
154
melm 716$9        Koha-Auth-Number,Koha-Auth-Number:n
(-)a/installer/data/mysql/updatedatabase.pl (+18 lines)
Lines 7104-7109 if ( CheckVersion($DBversion) ) { Link Here
7104
    SetVersion($DBversion);
7104
    SetVersion($DBversion);
7105
}
7105
}
7106
7106
7107
7108
7109
7110
7111
7112
$DBversion = "3.13.00.XXX";
7113
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
7114
    $dbh->do(q{
7115
        INSERT INTO systempreferences (variable,value,explanation,options,type)
7116
        VALUES('IdRef','0','Disable/enable the IdRef webservice from the OPAC detail page.',NULL,'YesNo')
7117
    });
7118
    print "Upgrade to $DBversion done (Bug 8992: Add system preference IdRef))\n";
7119
    SetVersion($DBversion);
7120
}
7121
7122
7123
7124
7107
=head1 FUNCTIONS
7125
=head1 FUNCTIONS
7108
7126
7109
=head2 TableExists($table)
7127
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref (+7 lines)
Lines 44-46 Web services: Link Here
44
            - pref: SvcMaxReportRows
44
            - pref: SvcMaxReportRows
45
              class: integer
45
              class: integer
46
            - rows of a report requested via the reports web service.
46
            - rows of a report requested via the reports web service.
47
    IdRef:
48
        -
49
            - pref: IdRef
50
              choices:
51
                yes: Enable
52
                no: Disable
53
            - the IdRef webservice from the opac detail page
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+10 lines)
Lines 3063-3065 padding: 0.1em 0; Link Here
3063
    display: block;
3063
    display: block;
3064
    overflow: auto;
3064
    overflow: auto;
3065
}
3065
}
3066
3067
/* IDREF */
3068
#idref h2.role {
3069
    background-color: #DDDEEE;
3070
    cursor: pointer;
3071
}
3072
3073
#idref table {
3074
    margin: 0;
3075
}
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/greybox.inc (+7 lines)
Line 0 Link Here
1
<script type="text/javascript">
2
    var GB_ROOT_DIR = "[% themelang %]/lib/greybox/";
3
</script>
4
<script type="text/javascript" src="[% themelang %]/lib/greybox/AJS.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/greybox/AJS_fx.js"></script>
6
<script type="text/javascript" src="[% themelang %]/lib/greybox/gb_scripts.js"></script>
7
<link href="[% themelang %]/lib/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +9 lines)
Lines 30-35 Link Here
30
[% END %]
30
[% END %]
31
[% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.rating.js"></script>
31
[% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.rating.js"></script>
32
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/jquery.rating.css" />[% END %]
32
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/jquery.rating.css" />[% END %]
33
[% INCLUDE greybox.inc %]
33
34
34
[% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.highlight-3.js"></script>[% END %]
35
[% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.highlight-3.js"></script>[% END %]
35
[% IF ( bidi ) %]
36
[% IF ( bidi ) %]
Lines 558-564 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
558
        [% XSLTBloc %]
559
        [% XSLTBloc %]
559
    [% ELSE %]
560
    [% ELSE %]
560
    <h1 class="title">[% title |html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield |html %] [% END %]</span>[% END %]</h1>
561
    <h1 class="title">[% title |html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield |html %] [% END %]</span>[% END %]</h1>
561
    [% IF ( author ) %]<h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author |html %]</a></h5>[% END %] 
562
    [% IF ( author ) %]
563
      <h5 class="author">
564
        by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author |html %]</a>
565
      </h5>
566
    [% END %]
562
567
563
    <span class="results_summary">[% UNLESS ( item_level_itypes ) %]
568
    <span class="results_summary">[% UNLESS ( item_level_itypes ) %]
564
        [
569
        [
Lines 618-623 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
618
            [% IF (MARCAUTHOR.authoritylink) %]
623
            [% IF (MARCAUTHOR.authoritylink) %]
619
                <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface %]/[% theme %]/images/filefind.png"></a>
624
                <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface %]/[% theme %]/images/filefind.png"></a>
620
            [% END %]
625
            [% END %]
626
            [% IF ( IDREF and MARCAUTHOR.unimarc3) %]
627
                <a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a>
628
            [% END %]
621
            [% UNLESS ( loop.last ) %]|[% END %]
629
            [% UNLESS ( loop.last ) %]|[% END %]
622
        [% END %]
630
        [% END %]
623
    </span>
631
    </span>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-idref.tt (+63 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your search IDREF for ppn [% unimarc3 %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'datatables.inc' %]
5
<script type="text/javascript">
6
  $(document).ready(function (){
7
      $("table").dataTable($.extend(true, {}, dataTablesDefaults, {
8
          "oLanguage": {
9
              "sSearch": _("Search all columns:")
10
          },
11
          'bFilter': false,
12
          'sPaginationType': 'four_button',
13
          'aoColumnDefs': [
14
              { 'aTargets': [-1, -2], 'bSortable': false }
15
          ],
16
          'aLengthMenu': [[10, 25, 50, 100, 250, 500, 1000, -1], [10, 25, 50, 100, 250, 500, 1000, _("All")]],
17
      }));
18
19
      $(".role").click(function(){
20
          var docs_node = $(this).parent().find("div.docs");
21
          if ( $(docs_node).is(":visible") ) {
22
              $(".docs").hide();
23
          } else {
24
              $(".docs").hide();
25
              docs_node.show();
26
          }
27
      });
28
      $(".docs").hide();
29
  });
30
</script>
31
</head>
32
<body>
33
<div id="idref">
34
  [% IF error %]
35
    This ppn is not found on the idref service.
36
  [% ELSE %]
37
    [% FOREACH role IN content %]
38
      <div>
39
        <h2 class="role" title="Click to expand this role">[% role.role_name %] ([% role.count %])</h2>
40
          <div class="docs">
41
            <table>
42
              <thead>
43
                <th>Citation</th>
44
                <th>Koha</th>
45
                <th>Sudoc</th>
46
              </thead>
47
              <tbody>
48
                [% FOREACH doc IN role.docs %]
49
                  <tr>
50
                    <td>[% doc.citation %]</td>
51
                    <td><a href="/cgi-bin/koha/opac-search.pl?q=kw,phr=[% doc.ppn %]" target="_blank">Koha</a></td>
52
                    <td><a href="http://www.sudoc.fr/[% doc.ppn %]" target="_blank">Sudoc</a></td>
53
                  </tr>
54
                [% END %]
55
              </tbody>
56
            </table>
57
          </div>
58
      </div>
59
    [% END %]
60
  [% END %]
61
</div>
62
[% INCLUDE 'opac-bottom.inc' %]
63
(-)a/opac/opac-detail.pl (+13 lines)
Lines 1036-1041 if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ Link Here
1036
    $template->param('OPACSearchForTitleIn' => $search_for_title);
1036
    $template->param('OPACSearchForTitleIn' => $search_for_title);
1037
}
1037
}
1038
1038
1039
#IDREF
1040
if ( C4::Context->preference("IDREF") ) {
1041
    # If the record comes from the SUDOC
1042
    if ( $record->field('009') ) {
1043
        my $unimarc3 = $record->field("009")->data;
1044
        if ( $unimarc3 =~ /^\d+$/ ) {
1045
            $template->param(
1046
                IDREF => 1,
1047
            );
1048
        }
1049
    }
1050
}
1051
1039
# We try to select the best default tab to show, according to what
1052
# We try to select the best default tab to show, according to what
1040
# the user wants, and what's available for display
1053
# the user wants, and what's available for display
1041
my $opac_serial_default = C4::Context->preference('opacSerialDefaultTab');
1054
my $opac_serial_default = C4::Context->preference('opacSerialDefaultTab');
(-)a/opac/opac-idref.pl (-1 / +91 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
5
use CGI;
6
use LWP::UserAgent;
7
use HTTP::Request::Common;
8
use JSON;
9
use Encode;
10
11
use C4::Auth;
12
use C4::Context;
13
use C4::Search;
14
use C4::Output;
15
16
my $cgi = new CGI;
17
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
18
    {
19
        template_name   => "opac-idref.tt",
20
        query           => $cgi,
21
        type            => "opac",
22
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
23
        flagsrequired   => { borrow => 1 },
24
    }
25
);
26
27
my $ua = LWP::UserAgent->new;
28
29
my $base = 'http://www.idref.fr/services/biblio/';
30
my $unimarc3 = $cgi->param('unimarc3');
31
32
my $request = HTTP::Request->new(
33
    'GET',
34
    $base . $unimarc3 . ".json",
35
);
36
$request->protocol('HTTP/1.1');
37
my $response = $ua->request($request);
38
if ( not $response->is_success) {
39
    $template->param(error => $base.$unimarc3.'.json');
40
    output_html_with_http_headers $cgi, $cookie, $template->output;
41
    exit;
42
}
43
44
my $content = Encode::decode("utf8", $response->content);
45
my $json = from_json( $content );
46
my $r;
47
my $role_name;
48
my @unimarc3;
49
my @results = ref $json->{sudoc}{result} eq "ARRAY"
50
            ? @{ $json->{sudoc}{result} }
51
            : ($json->{sudoc}{result});
52
53
for my $role_node ( @results ) {
54
    while ( my ( $k, $v ) = each %$role_node ) {
55
        next unless $k eq "role";
56
        my $role_name;
57
        my $count = 0;
58
        my $role_data = {};
59
        my @nodes = ref $v eq "ARRAY"
60
                    ? @$v
61
                    : ($v);
62
        for my $node ( @nodes ) {
63
            while ( ( $k, $v ) = each %$node ) {
64
                given ( $k ) {
65
                    when ( "roleName" ) {
66
                        $role_name = $v;
67
                        $role_data->{role_name} = $role_name;
68
                    }
69
                    when ( "count" ) {
70
                        $role_data->{count} = $v;
71
                    }
72
                    when ( "doc" ) {
73
                        push @{ $role_data->{docs} }, $v;
74
                    }
75
                    default {
76
                        # unimarcCode and marc21Code
77
                    }
78
                }
79
            }
80
        }
81
        push @$r, $role_data;
82
    }
83
}
84
85
$template->param(
86
    content => $r,
87
    unimarc3 => $unimarc3,
88
);
89
90
output_html_with_http_headers $cgi, $cookie, $template->output;
91

Return to bug 8992