Bugfix: Enabling guide box configuration parameter
authorChris Nighswonger <cnighswonger@foundations.edu>
Mon, 8 Feb 2010 20:23:58 +0000 (15:23 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 9 Feb 2010 01:54:44 +0000 (20:54 -0500)
This patch enables turning the guide boxes on/off in the patron
cards layout editor.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-layout.tmpl
patroncards/create-pdf.pl
patroncards/edit-layout.pl

index 188b88e..cc22661 100644 (file)
                                     <label for="page_side">Page Side:</label>
                                     <!-- TMPL_IF NAME="page_side" -->
                                     <input type="radio" name="page_side" id="page_side" value="F" />Front
-                                    <input type="radio" name="page_side" id="page_side" value="B" checked />Back
+                                    <input type="radio" name="page_side" id="page_side" value="B" checked="checked" />Back
                                     <!-- TMPL_ELSE -->
-                                    <input type="radio" name="page_side" id="page_side" value="F" checked />Front
+                                    <input type="radio" name="page_side" id="page_side" value="F" checked="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="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="checked" />Off
+                                    <!-- /TMPL_IF -->
                                 </li>
                                 </fieldset>
                                 </li>
index 656c31f..02ba793 100755 (executable)
@@ -120,7 +120,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
index 09edf42..38557b0 100755 (executable)
@@ -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;