[Koha-patches] [PATCH] Bugfix: Enabling guide box configuration parameter

Chris Nighswonger cnighswonger at foundations.edu
Mon Feb 8 19:00:43 CET 2010


This patch enables turning the guide boxes on/off in the patron
cards layout editor.
---
 .../prog/en/modules/patroncards/edit-layout.tmpl   |   11 ++++++++++-
 patroncards/create-pdf.pl                          |    2 +-
 patroncards/edit-layout.pl                         |    2 ++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tmpl
index 188b88e..6b3e36c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tmpl
@@ -184,7 +184,16 @@
                                     <input type="radio" name="page_side" id="page_side" value="F" checked />Front
                                     <input type="radio" name="page_side" id="page_side" value="B" />Back
                                     <!-- /TMPL_IF -->
-
+                                </li>
+                                <li>
+                                    <label for="guide_box">Guide Box:</label>
+                                    <!-- TMPL_IF NAME="guide_box" -->
+                                    <input type="radio" name="guide_box" id="guide_box" value="1" checked />On
+                                    <input type="radio" name="guide_box" id="guide_box" value="0" />Off
+                                    <!-- TMPL_ELSE -->
+                                    <input type="radio" name="guide_box" id="guide_box" value="1" />On
+                                    <input type="radio" name="guide_box" id="guide_box" value="0" checked />Off
+                                    <!-- /TMPL_IF -->
                                 </li>
                                 </fieldset>
                                 </li>
diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl
index 2a26c6e..c1a3c38 100755
--- a/patroncards/create-pdf.pl
+++ b/patroncards/create-pdf.pl
@@ -123,7 +123,7 @@ foreach my $item (@{$items}) {
                 layout                  => $layout_xml,
                 text_wrap_cols          => 30, #FIXME: hardcoded
         );
-        $patron_card->draw_guide_box($pdf);
+        $patron_card->draw_guide_box($pdf) if $layout_xml->{'guide_box'};
         $patron_card->draw_barcode($pdf) if $layout_xml->{'barcode'};
 
 #       Do image foo and place binary image data into layout hash
diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl
index 7b05f6c..0981a8a 100755
--- a/patroncards/edit-layout.pl
+++ b/patroncards/edit-layout.pl
@@ -145,6 +145,7 @@ if ($op eq 'edit') {
             layout_id       => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '',
             layout_name     => $layout->get_attr('layout_name'),
             page_side       => ($layout_xml->{'page_side'} eq 'F' ? 0 : 1),
+            guide_box       => $layout_xml->{'guide_box'},
             units           => $units,
             @barcode,
             barcode_type    => get_barcode_types(),
@@ -206,6 +207,7 @@ elsif  ($op eq 'save') {
             $layout_id = $cgi->param($parameter) if $parameter eq 'layout_id';
             $layout->{'units'} = $cgi->param($parameter) if $parameter eq 'units';
             $layout->{'page_side'} = $cgi->param($parameter) if $parameter eq 'page_side';
+            $layout->{'guide_box'} = $cgi->param($parameter) if $parameter eq 'guide_box';
         }
     }
     $layout->{'text'} = $text_lines;
-- 
1.6.0.4




More information about the Koha-patches mailing list