[Koha-patches] [PATCH] Bug 3173 Place Hold link visible in OPAC even if syspref turned off

Galen Charlton galen.charlton at liblime.com
Wed Apr 29 22:05:12 CEST 2009


Hi Jane,

This needs work - please see below:

On Wed, Apr 29, 2009 at 3:30 PM, Jane Wagner <jwagner at ptfs.com> wrote:
> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
> index a102457..5897f86 100644
> --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
> +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
> @@ -76,9 +76,10 @@ function tagAdded() {
>                );
>                return false;
>            });
> +       <!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="RequestOnOpac" -->
>         $(".holdsep").text("| ");
>         $(".hold").text("Place Hold");
> -
> +       <!-- /TMPL_IF -->

This change and the others like it in the other templates adds two
TMPL_IFs but only one closing /TMPL_IF - this is a guaranteed template
error.

> index 154d8af..29ec6a9 100755
> --- a/opac/opac-basket.pl
> +++ b/opac/opac-basket.pl
> @@ -54,8 +54,11 @@ if (C4::Context->preference('TagsEnabled')) {
>                C4::Context->preference($_) and $template->param($_ => 1);
>        }
>  }
> -
> -
> +# adding the $RequestOnOpac param
> +my $RequestOnOpac;
> +if (C4::Context->preference("RequestOnOpac")) {
> +        $RequestOnOpac = 1;
> +}
>  foreach my $biblionumber ( @bibs ) {
>     $template->param( biblionumber => $biblionumber );

This change and the other ones like it are in the odd situation of
being unnecessary but also not doing what you intended.  It's not
necessary because the RequestOnOpac syspref is one of the ones that's
automatically passed to $template for OPAC scripts (see line 343 of
C4/Auth.pm), but it also doesn't do what you intended because it only
sets a $RequestOnOpac variable without also calling $template->param()
to actually expose it to the template.

Regards,

Galen
-- 
Galen Charlton
VP, Research & Development, LibLime
galen.charlton at liblime.com
p: 1-888-564-2457 x709
skype: gmcharlt



More information about the Koha-patches mailing list