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

(-)a/C4/Biblio.pm (-41 / +43 lines)
Lines 1163-1212 sub GetCOinSBiblio { Link Here
1163
    my $isbn      = '';
1163
    my $isbn      = '';
1164
    my $issn      = '';
1164
    my $issn      = '';
1165
    my $publisher = '';
1165
    my $publisher = '';
1166
1166
    my $titletype = 'b';
1167
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
1167
1168
        my $fmts6;
1168
    # For the purposes of generating COinS metadata, LDR/06-07 can be
1169
        my $fmts7;
1169
    # considered the same for UNIMARC and MARC21
1170
        %$fmts6 = (
1170
    my $fmts6;
1171
            'a' => 'book',
1171
    my $fmts7;
1172
            'b' => 'manuscript',
1172
    %$fmts6 = (
1173
            'c' => 'book',
1173
                'a' => 'book',
1174
            'd' => 'manuscript',
1174
                'b' => 'manuscript',
1175
            'e' => 'map',
1175
                'c' => 'book',
1176
            'f' => 'map',
1176
                'd' => 'manuscript',
1177
            'g' => 'film',
1177
                'e' => 'map',
1178
            'i' => 'audioRecording',
1178
                'f' => 'map',
1179
            'j' => 'audioRecording',
1179
                'g' => 'film',
1180
            'k' => 'artwork',
1180
                'i' => 'audioRecording',
1181
            'l' => 'document',
1181
                'j' => 'audioRecording',
1182
            'm' => 'computerProgram',
1182
                'k' => 'artwork',
1183
            'r' => 'document',
1183
                'l' => 'document',
1184
1184
                'm' => 'computerProgram',
1185
        );
1185
                'o' => 'document',
1186
        %$fmts7 = (
1186
                'r' => 'document',
1187
            'a' => 'journalArticle',
1187
            );
1188
            's' => 'journal',
1188
    %$fmts7 = (
1189
        );
1189
                    'a' => 'journalArticle',
1190
1190
                    's' => 'journal',
1191
        $genre = $fmts6->{$pos6} ? $fmts6->{$pos6} : 'book';
1191
              );
1192
1192
1193
        if ( $genre eq 'book' ) {
1193
    $genre = $fmts6->{$pos6} ? $fmts6->{$pos6} : 'book';
1194
1195
    if ( $genre eq 'book' ) {
1194
            $genre = $fmts7->{$pos7} if $fmts7->{$pos7};
1196
            $genre = $fmts7->{$pos7} if $fmts7->{$pos7};
1195
        }
1197
    }
1196
1198
1197
        ##### We must transform mtx to a valable mtx and document type ####
1199
    ##### We must transform mtx to a valable mtx and document type ####
1198
        if ( $genre eq 'book' ) {
1200
    if ( $genre eq 'book' ) {
1199
            $mtx = 'book';
1201
            $mtx = 'book';
1200
        } elsif ( $genre eq 'journal' ) {
1202
    } elsif ( $genre eq 'journal' ) {
1201
            $mtx = 'journal';
1203
            $mtx = 'journal';
1202
        } elsif ( $genre eq 'journalArticle' ) {
1204
            $titletype = 'j';
1205
    } elsif ( $genre eq 'journalArticle' ) {
1203
            $mtx   = 'journal';
1206
            $mtx   = 'journal';
1204
            $genre = 'article';
1207
            $genre = 'article';
1205
        } else {
1208
            $titletype = 'a';
1209
    } else {
1206
            $mtx = 'dc';
1210
            $mtx = 'dc';
1207
        }
1211
    }
1212
1213
    $genre = ( $mtx eq 'dc' ) ? "&rft.type=$genre" : "&rft.genre=$genre";
1208
1214
1209
        $genre = ( $mtx eq 'dc' ) ? "&rft.type=$genre" : "&rft.genre=$genre";
1215
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
1210
1216
1211
        # Setting datas
1217
        # Setting datas
1212
        $aulast  = $record->subfield( '700', 'a' );
1218
        $aulast  = $record->subfield( '700', 'a' );
Lines 1230-1238 sub GetCOinSBiblio { Link Here
1230
    } else {
1236
    } else {
1231
1237
1232
        # MARC21 need some improve
1238
        # MARC21 need some improve
1233
        my $fmts;
1234
        $mtx   = 'book';
1235
        $genre = "&rft.genre=book";
1236
1239
1237
        # Setting datas
1240
        # Setting datas
1238
        if ( $record->field('100') ) {
1241
        if ( $record->field('100') ) {
Lines 1245-1251 sub GetCOinSBiblio { Link Here
1245
                $oauthors .= "&rft.au=$au";
1248
                $oauthors .= "&rft.au=$au";
1246
            }
1249
            }
1247
        }
1250
        }
1248
        $title = "&rft.btitle=" . $record->subfield( '245', 'a' );
1251
        $title = "&rft." . $titletype . "title=" . $record->subfield( '245', 'a' );
1249
        $subtitle = $record->subfield( '245', 'b' ) || '';
1252
        $subtitle = $record->subfield( '245', 'b' ) || '';
1250
        $title .= $subtitle;
1253
        $title .= $subtitle;
1251
        $pubyear   = $record->subfield( '260', 'c' ) || '';
1254
        $pubyear   = $record->subfield( '260', 'c' ) || '';
1252
- 

Return to bug 4366