@@ -, +, @@ --- C4/Members/AttributeTypes.pm | 32 +++++++++++++++++-- admin/patron-attr-types.pl | 11 ++++++- .../intranet-tmpl/prog/en/css/staff-global.css | 7 ++++ .../prog/en/modules/admin/patron-attr-types.tmpl | 5 +++ .../prog/en/modules/members/memberentrygen.tmpl | 14 ++++++-- members/memberentry.pl | 10 +++++- 6 files changed, 68 insertions(+), 11 deletions(-) --- a/C4/Members/AttributeTypes.pm +++ a/C4/Members/AttributeTypes.pm @@ -40,6 +40,7 @@ my @attribute_types = C4::Members::AttributeTypes::GetAttributeTypes(); my $attr_type = C4::Members::AttributeTypes->new($code, $description); $attr_type->code($code); $attr_type->description($description); +$attr_type->mandatory($mandatory); $attr_type->repeatable($repeatable); $attr_type->unique_id($unique_id); $attr_type->opac_display($opac_display); @@ -108,6 +109,7 @@ sub new { $self->{'code'} = shift; $self->{'description'} = shift; + $self->{'mandatory'} = 0; $self->{'repeatable'} = 0; $self->{'unique_id'} = 0; $self->{'opac_display'} = 0; @@ -146,6 +148,7 @@ sub fetch { $self->{'code'} = $row->{'code'}; $self->{'description'} = $row->{'description'}; + $self->{'mandatory'} = $row->{'mandatory'}; $self->{'repeatable'} = $row->{'repeatable'}; $self->{'unique_id'} = $row->{'unique_id'}; $self->{'opac_display'} = $row->{'opac_display'}; @@ -185,14 +188,15 @@ sub store { opac_display = ?, password_allowed = ?, staff_searchable = ?, - authorised_value_category = ? + authorised_value_category = ?, + mandatory = ? WHERE code = ?"); } else { $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types (description, repeatable, unique_id, opac_display, password_allowed, - staff_searchable, authorised_value_category, code) + staff_searchable, authorised_value_category, mandatory, code) VALUES (?, ?, ?, ?, ?, - ?, ?, ?)"); + ?, ?, ?, ? )"); } $sth->bind_param(1, $self->{'description'}); $sth->bind_param(2, $self->{'repeatable'}); @@ -201,7 +205,8 @@ sub store { $sth->bind_param(5, $self->{'password_allowed'}); $sth->bind_param(6, $self->{'staff_searchable'}); $sth->bind_param(7, $self->{'authorised_value_category'}); - $sth->bind_param(8, $self->{'code'}); + $sth->bind_param(8, $self->{'mandatory'}); + $sth->bind_param(9, $self->{'code'}); $sth->execute; } @@ -243,6 +248,25 @@ sub description { @_ ? $self->{'description'} = shift : $self->{'description'}; } +=head2 mandatory + +=over 4 + +my $mandatory = $attr_type->mandatory(); +$attr_type->mandatory($mandatory); + +=back + +Accessor. The C<$mandatory> argument +is interpreted as a Perl boolean. + +=cut + +sub mandatory { + my $self = shift; + @_ ? $self->{'mandatory'} = ((shift) ? 1 : 0) : $self->{'mandatory'}; +} + =head2 repeatable =over 4 --- a/admin/patron-attr-types.pl +++ a/admin/patron-attr-types.pl @@ -89,6 +89,9 @@ sub error_add_attribute_type_form { $template->param(description => $input->param('description')); + if ($input->param('mandatory')) { + $template->param(mandatory_checked => 'checked="checked"'); + } if ($input->param('repeatable')) { $template->param(repeatable_checked => 'checked="checked"'); } @@ -137,6 +140,9 @@ sub add_update_attribute_type { $attr_type->unique_id($unique_id); } + my $mandatory = $input->param('mandatory'); + $attr_type->mandatory($mandatory); + warn "Mand: $mandatory"; my $opac_display = $input->param('opac_display'); $attr_type->opac_display($opac_display); my $staff_searchable = $input->param('staff_searchable'); @@ -202,7 +208,10 @@ sub edit_attribute_type_form { $template->param(code => $code); $template->param(description => $attr_type->description()); - +warn "Attr->mand: " . $attr_type->mandatory(); + if ($attr_type->mandatory()) { + $template->param(mandatory_checked => 'checked="checked"'); + } if ($attr_type->repeatable()) { $template->param(repeatable_checked => 'checked="checked"'); } --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -325,6 +325,7 @@ span.problem { line-height : 1.7em; } + fieldset { border : 2px solid #EEEEEE; margin : 1em 1em 1em 0; @@ -392,6 +393,12 @@ div#reserves,div#checkouts { padding : 1em; } +span.renewals-disabled { + color : #990000; + font-weight : bold; +} + + .tip { font-size: 93%; color : Gray; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tmpl +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tmpl @@ -103,6 +103,11 @@ this feature on. " /> +