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

(-)a/C4/Search.pm (-2 / +2 lines)
Lines 1338-1344 sub searchResults { Link Here
1338
    my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults ) = @_;
1338
    my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults ) = @_;
1339
    my $dbh = C4::Context->dbh;
1339
    my $dbh = C4::Context->dbh;
1340
    my @newresults;
1340
    my @newresults;
1341
1342
    #Build branchnames hash
1341
    #Build branchnames hash
1343
    #find branchname
1342
    #find branchname
1344
    #get branch information.....
1343
    #get branch information.....
Lines 1672-1680 sub searchResults { Link Here
1672
        }
1671
        }
1673
1672
1674
        # XSLT processing of some stuff
1673
        # XSLT processing of some stuff
1674
        # FIXME : This needs some work in order to be more flexible : Can not use a result list for intranet different from OPAC
1675
        if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
1675
        if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
1676
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display(
1676
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display(
1677
                $oldbiblio->{biblionumber}, $marcrecord, 'Results' );
1677
                $oldbiblio->{biblionumber}, $marcrecord, C4::Context->preference("XSLTResultsDisplay") );
1678
        }
1678
        }
1679
1679
1680
        # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
1680
        # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
(-)a/C4/XSLT.pm (-10 / +30 lines)
Lines 26-31 use C4::Circulation; Link Here
26
use Encode;
26
use Encode;
27
use XML::LibXML;
27
use XML::LibXML;
28
use XML::LibXSLT;
28
use XML::LibXSLT;
29
use LWP::Simple;
29
30
30
use strict;
31
use strict;
31
32
Lines 37-42 BEGIN { Link Here
37
    @ISA = qw(Exporter);
38
    @ISA = qw(Exporter);
38
    @EXPORT = qw(
39
    @EXPORT = qw(
39
        &XSLTParse4Display
40
        &XSLTParse4Display
41
        &GetURI
40
    );
42
    );
41
}
43
}
42
44
Lines 46-51 C4::XSLT - Functions for displaying XSLT-generated content Link Here
46
48
47
=head1 FUNCTIONS
49
=head1 FUNCTIONS
48
50
51
=head1 GetURI
52
53
=head2 GetURI file and returns the xslt as a string
54
55
=cut
56
57
sub GetURI {
58
    my ($uri) = @_;
59
    my $string;
60
    $string = get $uri ; 
61
    return $string;
62
}
63
49
=head1 transformMARCXML4XSLT
64
=head1 transformMARCXML4XSLT
50
65
51
=head2 replaces codes with authorized values in a MARC::Record object
66
=head2 replaces codes with authorized values in a MARC::Record object
Lines 118-124 sub getAuthorisedValues4MARCSubfields { Link Here
118
my $stylesheet;
133
my $stylesheet;
119
134
120
sub XSLTParse4Display {
135
sub XSLTParse4Display {
121
    my ( $biblionumber, $orig_record, $xsl_suffix ) = @_;
136
    my ( $biblionumber, $orig_record, $xslfilename ) = @_;
122
    # grab the XML, run it through our stylesheet, push it out to the browser
137
    # grab the XML, run it through our stylesheet, push it out to the browser
123
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
138
    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
124
    #return $record->as_formatted();
139
    #return $record->as_formatted();
Lines 129-145 sub XSLTParse4Display { Link Here
129
    # don't die when you find &, >, etc
144
    # don't die when you find &, >, etc
130
    $parser->recover_silently(1);
145
    $parser->recover_silently(1);
131
    my $source = $parser->parse_string($xmlrecord);
146
    my $source = $parser->parse_string($xmlrecord);
132
    unless ( $stylesheet ) {
147
    unless ( $stylesheet->{$xslfilename} ) {
133
        my $xslt = XML::LibXSLT->new();
148
        my $xslt = XML::LibXSLT->new();
134
        my $xslfile = C4::Context->config('opachtdocs') . 
149
        my $style_doc;
135
                      "/prog/en/xslt/" .
150
        if ($xslfilename=~/http:/){
136
                      C4::Context->preference('marcflavour') .
151
            my $xsltstring=GetURI($xslfilename);
137
                      "slim2OPAC$xsl_suffix.xsl";
152
            $style_doc = $parser->parse_string($xsltstring);
138
        my $style_doc = $parser->parse_file($xslfile);
153
        }
139
        $stylesheet = $xslt->parse_stylesheet($style_doc);
154
        else {
155
            use Cwd;
156
            warn getcwd;
157
            $style_doc = $parser->parse_file($xslfilename);
158
        }
159
        $stylesheet->{$xslfilename} = $xslt->parse_stylesheet($style_doc);
140
    }
160
    }
141
    my $results = $stylesheet->transform($source);
161
    my $results = $stylesheet->{$xslfilename}->transform($source);
142
    my $newxmlrecord = $stylesheet->output_string($results);
162
    my $newxmlrecord = $stylesheet->{$xslfilename}->output_string($results);
143
    return $newxmlrecord;
163
    return $newxmlrecord;
144
}
164
}
145
165
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (-2 / +2 lines)
Lines 204-211 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES Link Here
204
204
205
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo');
205
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo');
206
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
206
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
207
('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo'),
207
('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl','Textarea'),
208
('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo');
208
('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl','Textarea');
209
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice');
209
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice');
210
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
210
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
211
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
211
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (-2 / +2 lines)
Lines 206-213 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES Link Here
206
	('TagsShowOnList',   '6','','Nombre de tags à afficher sur la page de résultat, 0 désactivant l''affichage.','Integer');
206
	('TagsShowOnList',   '6','','Nombre de tags à afficher sur la page de résultat, 0 désactivant l''affichage.','Integer');
207
207
208
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Active le parcours des rayonnages sur la page de détail','YesNo');
208
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Active le parcours des rayonnages sur la page de détail','YesNo');
209
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo');
209
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Permet l''utilisation de feuilles de style XSLT pour l''affichage détaillé de notice exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl','Textarea');
210
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Permet l''utilisation de Feuilles de style XSLT pour l''affichage des listes de résultat (MARC21)','YesNo');
210
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Permet l''utilisation de Feuilles de style XSLT pour l''affichage des listes de résultat exemple : ../koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl','Textarea');
211
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Détermine quel index utiliser lors des recherches par type de document','Choice');
211
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Détermine quel index utiliser lors des recherches par type de document','Choice');
212
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Permet la réservation d''exemplaires non disponibles', 'YesNo');
212
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Permet la réservation d''exemplaires non disponibles', 'YesNo');
213
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Permet les réservations sur des exemplaires endommagés', 'YesNo');
213
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Permet les réservations sur des exemplaires endommagés', 'YesNo');
(-)a/installer/data/mysql/updatedatabase30.pl (+9 lines)
Lines 705-710 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
705
    SetVersion ($DBversion);
705
    SetVersion ($DBversion);
706
}
706
}
707
707
708
$DBversion = "3.00.06.003";
709
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
710
    $dbh->do("UPDATE systempreferences set value='../koha-tmpl/opac-tmpl/prog/en/xslt/".C4::Context->preference('marcflavour')."slim2OPACDetail.xsl' where variable='XSLTDetailsDisplay' AND value=1;");
711
    $dbh->do("UPDATE systempreferences set value='../koha-tmpl/opac-tmpl/prog/en/xslt/".C4::Context->preference('marcflavour')."slim2OPACResults.xsl' where variable='XSLTResultsDisplay' AND value=1;");
712
    print "Upgrade to $DBversion done (Improve XSLT)\n";
713
    SetVersion ($DBversion);
714
}
715
716
708
=item DropAllForeignKeys($table)
717
=item DropAllForeignKeys($table)
709
718
710
  Drop all foreign keys of the table $table
719
  Drop all foreign keys of the table $table
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 10-16 Link Here
10
use strict;
10
use strict;
11
11
12
sub kohaversion {
12
sub kohaversion {
13
    our $VERSION = '3.00.05.003';
13
    our $VERSION = '3.00.06.003';
14
    # version needs to be set this way
14
    # version needs to be set this way
15
    # so that it can be picked up by Makefile.PL
15
    # so that it can be picked up by Makefile.PL
16
    # during install
16
    # during install
(-)a/opac/opac-detail.pl (-2 / +1 lines)
Lines 70-76 $template->param( biblionumber => $biblionumber ); Link Here
70
# XSLT processing of some stuff
70
# XSLT processing of some stuff
71
if (C4::Context->preference("XSLTDetailsDisplay") ) {
71
if (C4::Context->preference("XSLTDetailsDisplay") ) {
72
    $template->param(
72
    $template->param(
73
        'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail') );
73
        'XSLTBloc' => XSLTParse4Display($biblionumber, $record, C4::Context->preference("XSLTDetailsDisplay")) );
74
}
74
}
75
75
76
# change back when ive fixed request.pl
76
# change back when ive fixed request.pl
77
- 

Return to bug 4032