|
Lines 141-146
if ($op eq 'edit') {
Link Here
|
| 141 |
push @barcode, (($barcode_param eq 'type' ? ("barcode_" . $barcode_param => _set_selected($layout_xml->{'barcode'}->[0]->{'barcode_type'}, $barcode_types)) : ("barcode_" . $barcode_param => $layout_xml->{'barcode'}->[0]->{$barcode_param}))); |
141 |
push @barcode, (($barcode_param eq 'type' ? ("barcode_" . $barcode_param => _set_selected($layout_xml->{'barcode'}->[0]->{'barcode_type'}, $barcode_types)) : ("barcode_" . $barcode_param => $layout_xml->{'barcode'}->[0]->{$barcode_param}))); |
| 142 |
} |
142 |
} |
| 143 |
|
143 |
|
|
|
144 |
foreach my $unit (@$units){ |
| 145 |
if ($unit->{'type'} eq $layout->get_attr('units')) { |
| 146 |
$unit->{'selected'} = 1; |
| 147 |
} |
| 148 |
} |
| 149 |
|
| 144 |
$template->param( |
150 |
$template->param( |
| 145 |
layout_id => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '', |
151 |
layout_id => $layout->get_attr('layout_id') > -1 ? $layout->get_attr('layout_id') : '', |
| 146 |
layout_name => $layout->get_attr('layout_name'), |
152 |
layout_name => $layout->get_attr('layout_name'), |
|
Lines 212-217
elsif ($op eq 'save') {
Link Here
|
| 212 |
} |
218 |
} |
| 213 |
$layout->{'text'} = $text_lines; |
219 |
$layout->{'text'} = $text_lines; |
| 214 |
my @params = (layout_name => $layout_name, layout_id => $layout_id, layout_xml => XMLout($layout)); |
220 |
my @params = (layout_name => $layout_name, layout_id => $layout_id, layout_xml => XMLout($layout)); |
|
|
221 |
push(@params,units => $layout->{'units'}) if $layout->{'units'}; |
| 215 |
if ($layout_id) { # if a label_id was passed in, this is an update to an existing layout |
222 |
if ($layout_id) { # if a label_id was passed in, this is an update to an existing layout |
| 216 |
$layout = C4::Patroncards::Layout->retrieve(layout_id => $layout_id); |
223 |
$layout = C4::Patroncards::Layout->retrieve(layout_id => $layout_id); |
| 217 |
$layout->set_attr(@params); |
224 |
$layout->set_attr(@params); |
| 218 |
- |
|
|