[Koha-patches] [PATCH] Bugfix: Fixing hardcoded dir paths in C4::XSLT

Chris Nighswonger cnighswonger at foundations.edu
Thu Jan 28 21:34:18 CET 2010


I'm withdrawing this patch in favor of work done by BibLibre on the
XSLT features of Koha (soon to be submitted).

On Thu, Jan 28, 2010 at 12:38 PM, Chris Nighswonger
<cnighswonger at foundations.edu> wrote:
> This is the resubmit.
>
>
> On Thu, Jan 28, 2010 at 12:35 PM, Chris Nighswonger
> <cnighswonger at foundations.edu> wrote:
>> This patch makes C4::XSLT.pm obey the 'themes/opacthemes' system preferences
>> ---
>>  C4/XSLT.pm |   16 ++++++++--------
>>  1 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/C4/XSLT.pm b/C4/XSLT.pm
>> index 8a67e04..db9717a 100644
>> --- a/C4/XSLT.pm
>> +++ b/C4/XSLT.pm
>> @@ -73,7 +73,7 @@ sub transformMARCXML4XSLT {
>>                     $value = GetAuthorisedValueDesc( $tag, $letter, $value, '', $tagslib )
>>                         if $av->{ $tag }->{ $letter };
>>                     push( @new_subfields, $letter, $value );
>> -                }
>> +                }
>>                 $field ->replace_with( MARC::Field->new(
>>                     $tag,
>>                     $field->indicator(1),
>> @@ -143,13 +143,13 @@ sub XSLTParse4Display {
>>         my $xslt = XML::LibXSLT->new();
>>         my $xslfile;
>>         if ($interface eq 'intranet') {
>> -            $xslfile = C4::Context->config('intrahtdocs') .
>> -                      "/prog/en/xslt/" .
>> +            $xslfile = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('themes') .
>> +                      "/en/xslt/" .
>>                       C4::Context->preference('marcflavour') .
>>                       "slim2intranet$xsl_suffix.xsl";
>>         } else {
>> -            $xslfile = C4::Context->config('opachtdocs') .
>> -                      "/prog/en/xslt/" .
>> +            $xslfile = C4::Context->config('opachtdocs') . '/' . C4::Context->preference('opacthemes') .
>> +                      "/en/xslt/" .
>>                       C4::Context->preference('marcflavour') .
>>                       "slim2OPAC$xsl_suffix.xsl";
>>         }
>> @@ -176,7 +176,7 @@ sub buildKohaItemsNamespace {
>>              (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} ) {
>>             if ( $item->{notforloan} < 0) {
>>                 $status = "On order";
>> -            }
>> +            }
>>             if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) {
>>                 $status = "reference";
>>             }
>> @@ -190,7 +190,7 @@ sub buildKohaItemsNamespace {
>>                 $status = "Lost";
>>             }
>>             if ($item->{damaged}) {
>> -                $status = "Damaged";
>> +                $status = "Damaged";
>>             }
>>             if (defined $transfertwhen && $transfertwhen ne '') {
>>                 $status = 'In transit';
>> @@ -201,7 +201,7 @@ sub buildKohaItemsNamespace {
>>         my $homebranch = $branches->{$item->{homebranch}}->{'branchname'};
>>         $xml.= "<item><homebranch>$homebranch</homebranch>".
>>                "<status>$status</status>".
>> -               (defined $item->{'itemcallnumber'} ? "<itemcallnumber>".$item->{'itemcallnumber'}."</itemcallnumber>"
>> +               (defined $item->{'itemcallnumber'} ? "<itemcallnumber>".$item->{'itemcallnumber'}."</itemcallnumber>"
>>                                            : "<itemcallnumber />")
>>         . "</item>";
>>
>> --
>> 1.6.0.4
>>
>>
>


More information about the Koha-patches mailing list