[Koha-patches] [PATCH] Replace TMPL_ELSIF with TMPL_ELSE and TMPL_IF in label-manager.tmpl;
Joshua Ferraro
jmf at liblime.com
Mon Jul 28 13:35:36 CEST 2008
MJ, can you clarify the purpose of this patch? Why are you preferring
separate ELSE and IF
over ELSIF ?
Josh
On Sun, Jul 27, 2008 at 6:59 PM, MJ Ray <mjr at phonecoop.coop> wrote:
> From: MJRay <mjr at serene.r2.ldn.ttllp.co.uk>
>
> Minor tidying to label-manager.pl
> ---
> .../prog/en/modules/labels/label-manager.tmpl | 14 +++++++-------
> labels/label-manager.pl | 9 +++++----
> 2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl
> index 056a639..a17a1c7 100644
> --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl
> +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manager.tmpl
> @@ -1,11 +1,11 @@
> -<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Tools › Labels › <!-- TMPL_IF NAME="batch_is_labels" -->Label<!-- TMPL_ELSIF NAME="batch_is_patroncards" -->Patron Card<!-- TMPL_ELSE -->Unknown Batchtype<!-- /TMPL_IF --> Batch</title>
> +<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha › Tools › Labels › <!-- TMPL_IF NAME="batch_is_labels" -->Label<!-- TMPL_ELSE --><!-- TMPL_IF NAME="batch_is_patroncards" -->Patron Card<!-- TMPL_ELSE -->Unknown Batchtype<!-- /TMPL_IF --><!-- /TMPL_IF --> Batch</title>
> <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
> </head>
> <body>
> <!-- TMPL_INCLUDE NAME="header.inc" -->
> <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
>
> -<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a> › <!-- TMPL_IF NAME="batch_is_labels" -->Label<!-- TMPL_ELSIF NAME="batch_is_patroncards" -->Patron Card<!-- TMPL_ELSE -->Unknown Batchtype<!-- /TMPL_IF --> Batch</div>
> +<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a> › <!-- TMPL_IF NAME="batch_is_labels" -->Label<!-- TMPL_ELSE --><!-- TMPL_IF NAME="batch_is_patroncards" -->Patron Card<!-- TMPL_ELSE -->Unknown Batchtype<!-- /TMPL_IF --><!-- /TMPL_IF --> Batch</div>
> <div id="doc3" class="yui-t2">
> <div id="bd">
> <div id="yui-main">
> @@ -42,7 +42,7 @@
> </tr>
> <!-- /TMPL_LOOP -->
> </table>
> -<!-- TMPL_ELSIF NAME="batch_is_patroncards" -->
> +<!-- TMPL_ELSE --><!-- TMPL_IF NAME="batch_is_patroncards" -->
> <h2>Patron Cards to be Printed for Batch <!-- TMPL_VAR NAME="batch_id" --> (<!-- TMPL_VAR NAME="batch_count" --> items)</h2>
> <table>
> <tr>
> @@ -64,8 +64,8 @@
> <!-- /TMPL_LOOP -->
> </table>
> <!-- TMPL_ELSE -->
> - <span class="error">Error: Unknown Batch Type "<!-- TMPL_VAR NAME="batch_type" -->"
> -<!-- /TMPL_IF -->
> + <span class="error">Error: Unknown Batch Type "<!-- TMPL_VAR NAME="batch_type" -->" <!-- TMPL_VAR NAME="batch_is_patroncards" -->
> +<!-- /TMPL_IF --><!-- /TMPL_IF -->
> </div>
> <div class="yui-u">
> <!-- TMPL_INCLUDE NAME="label-status.inc" -->
> @@ -109,7 +109,7 @@
> <!-- TMPL_INCLUDE NAME="label-status.inc" -->
> </div>
> </div>
> -<!-- TMPL_ELSIF NAME="batch_is_patroncards" -->
> +<!-- TMPL_ELSE --><!-- TMPL_IF NAME="batch_is_patroncards" -->
> <div class="yui-g">
> <div class="yui-u first">
> <!-- TMPL_IF NAME="batches" -->
> @@ -145,7 +145,7 @@
> <!-- TMPL_INCLUDE NAME="label-status.inc" -->
> </div>
> </div>
> -<!-- /TMPL_IF --><!-- /type -->
> +<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /type -->
> <!-- /TMPL_IF --><!-- batch_id -->
> </div>
> </div>
> diff --git a/labels/label-manager.pl b/labels/label-manager.pl
> index 64f48db..06a41f1 100755
> --- a/labels/label-manager.pl
> +++ b/labels/label-manager.pl
> @@ -42,9 +42,10 @@ my $guidebox = $query->param('guidebox');
> my $fontsize = $query->param('fontsize');
> my $formatstring = $query->param('formatstring');
> my $batch_type = $query->param('type');
> -($batch_type and $batch_type eq 'patroncards') or $batch_type = 'labels';
> -my @itemnumber;
> -($batch_type eq 'labels') ? (@itemnumber = $query->param('itemnumber')) : (@itemnumber = $query->param('borrowernumber'));
> +if (!defined($batch_type) or ($batch_type ne 'patroncards') ) {
> + $batch_type = 'labels';
> +}
> +my @itemnumber = ($batch_type eq 'labels') ? ($query->param('itemnumber')) : ($query->param('borrowernumber'));
>
> # little block for displaying active layout/template/batch in templates
> # ----------
> @@ -180,7 +181,7 @@ if (scalar @messages) {
> }
> $template->param(message_loop => \@complex);
> }
> -if ($batch_type eq 'labels' or $batch_type eq 'patroncards') {
> +if ( ($batch_type eq 'labels') or ($batch_type eq 'patroncards') ) {
> $template->param("batch_is_$batch_type" => 1);
> }
> $template->param(
> --
> 1.5.3.7
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-patches
>
--
Joshua Ferraro SUPPORT FOR OPEN-SOURCE SOFTWARE
CEO migration, training, maintenance, support
LibLime Featuring Koha Open-Source ILS
jmf at liblime.com |Full Demos at http://liblime.com/koha |1(888)KohaILS
More information about the Koha-patches
mailing list