#! /usr/bin/perl
#
# Copyright 2008 LibLime
+# Parts copyright 2010 BibLibre
#
# This file is part of Koha.
#
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
use strict;
+use warnings;
use CGI;
use C4::Auth;
use C4::Context;
my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl";
my $input = new CGI;
-my $op = $input->param('op');
+my $op = $input->param('op') || '';
my ($template, $loggedinuser, $cookie)
$template->param(description => $input->param('description'));
if ($input->param('repeatable')) {
- $template->param(repeatable_checked => 'checked="checked"');
+ $template->param(repeatable_checked => 1);
}
if ($input->param('unique_id')) {
- $template->param(unique_id_checked => 'checked="checked"');
+ $template->param(unique_id_checked => 1);
}
if ($input->param('password_allowed')) {
- $template->param(password_allowed_checked => 'checked="checked"');
+ $template->param(password_allowed_checked => 1);
}
if ($input->param('opac_display')) {
- $template->param(opac_display_checked => 'checked="checked"');
+ $template->param(opac_display_checked => 1);
}
if ($input->param('staff_searchable')) {
- $template->param(staff_searchable_checked => 'checked="checked"');
+ $template->param(staff_searchable_checked => 1);
+ }
+ if ($input->param('display_checkout')) {
+ $template->param(display_checkout_checked => 'checked="checked"');
}
$template->param(
$attr_type->authorised_value_category($authorised_value_category);
my $password_allowed = $input->param('password_allowed');
$attr_type->password_allowed($password_allowed);
+ my $display_checkout = $input->param('display_checkout');
+ $attr_type->display_checkout($display_checkout);
if ($op eq 'edit') {
$template->param(edited_attribute_type => $attr_type->code());
$template->param(description => $attr_type->description());
if ($attr_type->repeatable()) {
- $template->param(repeatable_checked => 'checked="checked"');
+ $template->param(repeatable_checked => 1);
}
- $template->param(repeatable_disabled => 'disabled="disabled"');
+ $template->param(repeatable_disabled => 1);
if ($attr_type->unique_id()) {
- $template->param(unique_id_checked => 'checked="checked"');
+ $template->param(unique_id_checked => 1);
}
- $template->param(unique_id_disabled => 'disabled="disabled"');
+ $template->param(unique_id_disabled => 1);
if ($attr_type->password_allowed()) {
- $template->param(password_allowed_checked => 'checked="checked"');
+ $template->param(password_allowed_checked => 1);
}
if ($attr_type->opac_display()) {
- $template->param(opac_display_checked => 'checked="checked"');
+ $template->param(opac_display_checked => 1);
}
if ($attr_type->staff_searchable()) {
- $template->param(staff_searchable_checked => 'checked="checked"');
+ $template->param(staff_searchable_checked => 1);
+ }
+ if ($attr_type->display_checkout()) {
+ $template->param(display_checkout_checked => 'checked="checked"');
}
-
authorised_value_category_list($template, $attr_type->authorised_value_category());
$template->param(