[Koha-patches] [PATCH] Replace TMPL_ELSIF with TMPL_ELSE and TMPL_IF in label-manager.tmpl;

MJ Ray mjr at phonecoop.coop
Mon Jul 28 00:59:09 CEST 2008


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 &rsaquo; Tools &rsaquo; Labels &rsaquo; <!-- 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 &rsaquo; Tools &rsaquo; Labels &rsaquo; <!-- 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> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a> &rsaquo; <!-- 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> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/labels/label-home.pl">Labels</a> &rsaquo; <!-- 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 &quot;<!-- TMPL_VAR NAME="batch_type" -->&quot;
-<!-- /TMPL_IF -->
+	<span class="error">Error: Unknown Batch Type &quot;<!-- TMPL_VAR NAME="batch_type" -->&quot; <!-- 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




More information about the Koha-patches mailing list