Lines 37-42
C4::Members::AttributeTypes - mananage extended patron attribute types
Link Here
|
37 |
$attr_type->repeatable($repeatable); |
37 |
$attr_type->repeatable($repeatable); |
38 |
$attr_type->unique_id($unique_id); |
38 |
$attr_type->unique_id($unique_id); |
39 |
$attr_type->opac_display($opac_display); |
39 |
$attr_type->opac_display($opac_display); |
|
|
40 |
$attr_type->opac_editable($opac_editable); |
40 |
$attr_type->staff_searchable($staff_searchable); |
41 |
$attr_type->staff_searchable($staff_searchable); |
41 |
$attr_type->authorised_value_category($authorised_value_category); |
42 |
$attr_type->authorised_value_category($authorised_value_category); |
42 |
$attr_type->store(); |
43 |
$attr_type->store(); |
Lines 122-127
sub new {
Link Here
|
122 |
$self->{'repeatable'} = 0; |
123 |
$self->{'repeatable'} = 0; |
123 |
$self->{'unique_id'} = 0; |
124 |
$self->{'unique_id'} = 0; |
124 |
$self->{'opac_display'} = 0; |
125 |
$self->{'opac_display'} = 0; |
|
|
126 |
$self->{'opac_editable'} = 0; |
125 |
$self->{'staff_searchable'} = 0; |
127 |
$self->{'staff_searchable'} = 0; |
126 |
$self->{'display_checkout'} = 0; |
128 |
$self->{'display_checkout'} = 0; |
127 |
$self->{'authorised_value_category'} = ''; |
129 |
$self->{'authorised_value_category'} = ''; |
Lines 163-168
sub fetch {
Link Here
|
163 |
$self->{'repeatable'} = $row->{'repeatable'}; |
165 |
$self->{'repeatable'} = $row->{'repeatable'}; |
164 |
$self->{'unique_id'} = $row->{'unique_id'}; |
166 |
$self->{'unique_id'} = $row->{'unique_id'}; |
165 |
$self->{'opac_display'} = $row->{'opac_display'}; |
167 |
$self->{'opac_display'} = $row->{'opac_display'}; |
|
|
168 |
$self->{'opac_editable'} = $row->{'opac_editable'}; |
166 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
169 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
167 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
170 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
168 |
$self->{'authorised_value_category'} = $row->{'authorised_value_category'}; |
171 |
$self->{'authorised_value_category'} = $row->{'authorised_value_category'}; |
Lines 203-208
sub store {
Link Here
|
203 |
repeatable = ?, |
206 |
repeatable = ?, |
204 |
unique_id = ?, |
207 |
unique_id = ?, |
205 |
opac_display = ?, |
208 |
opac_display = ?, |
|
|
209 |
opac_editable = ?, |
206 |
staff_searchable = ?, |
210 |
staff_searchable = ?, |
207 |
authorised_value_category = ?, |
211 |
authorised_value_category = ?, |
208 |
display_checkout = ?, |
212 |
display_checkout = ?, |
Lines 211-233
sub store {
Link Here
|
211 |
WHERE code = ?"); |
215 |
WHERE code = ?"); |
212 |
} else { |
216 |
} else { |
213 |
$sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types |
217 |
$sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types |
214 |
(description, repeatable, unique_id, opac_display, |
218 |
(description, repeatable, unique_id, opac_display, opac_editable, |
215 |
staff_searchable, authorised_value_category, display_checkout, category_code, class, code) |
219 |
staff_searchable, authorised_value_category, display_checkout, category_code, class, code) |
216 |
VALUES (?, ?, ?, ?, |
220 |
VALUES (?, ?, ?, ?, |
217 |
?, ?, ?, ?, ?, ?)"); |
221 |
?, ?, ?, ?, ?, ?)"); |
218 |
} |
222 |
} |
219 |
$sth->execute( |
223 |
$sth->bind_param(1, $self->{'description'}); |
220 |
$self->{description}, |
224 |
$sth->bind_param(2, $self->{'repeatable'}); |
221 |
$self->{repeatable}, |
225 |
$sth->bind_param(3, $self->{'unique_id'}); |
222 |
$self->{unique_id}, |
226 |
$sth->bind_param(4, $self->{'opac_display'}); |
223 |
$self->{opac_display}, |
227 |
$sth->bind_param(5, $self->{'opac_editable'}); |
224 |
$self->{staff_searchable}, |
228 |
$sth->bind_param(7, $self->{'staff_searchable'}); |
225 |
$self->{authorised_value_category}, |
229 |
$sth->bind_param(8, $self->{'authorised_value_category'}); |
226 |
$self->{display_checkout}, |
230 |
$sth->bind_param(9, $self->{'display_checkout'}); |
227 |
$self->{category_code} || undef, |
231 |
$sth->bind_param(10, $self->{'category_code'} || undef); |
228 |
$self->{class}, |
232 |
$sth->bind_param(11, $self->{'class'}); |
229 |
$self->{code}, |
233 |
$sth->bind_param(12, $self->{'code'}); |
230 |
); |
234 |
$sth->execute; |
231 |
|
235 |
|
232 |
if ( defined $$self{branches} ) { |
236 |
if ( defined $$self{branches} ) { |
233 |
$sth = $dbh->prepare("DELETE FROM borrower_attribute_types_branches WHERE bat_code = ?"); |
237 |
$sth = $dbh->prepare("DELETE FROM borrower_attribute_types_branches WHERE bat_code = ?"); |
Lines 335-340
sub opac_display {
Link Here
|
335 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
339 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
336 |
} |
340 |
} |
337 |
|
341 |
|
|
|
342 |
=head2 opac_editable |
343 |
|
344 |
my $opac_editable = $attr_type->opac_editable(); |
345 |
$attr_type->opac_editable($opac_editable); |
346 |
|
347 |
Accessor. The C<$opac_editable> argument |
348 |
is interpreted as a Perl boolean. |
349 |
|
350 |
=cut |
351 |
|
352 |
sub opac_editable { |
353 |
my $self = shift; |
354 |
@_ ? $self->{'opac_editable'} = ((shift) ? 1 : 0) : $self->{'opac_editable'}; |
355 |
} |
356 |
|
338 |
=head2 staff_searchable |
357 |
=head2 staff_searchable |
339 |
|
358 |
|
340 |
my $staff_searchable = $attr_type->staff_searchable(); |
359 |
my $staff_searchable = $attr_type->staff_searchable(); |