|
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-232
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, |
| 215 |
staff_searchable, authorised_value_category, display_checkout, category_code, class, code) |
219 |
repeatable, |
| 216 |
VALUES (?, ?, ?, ?, |
220 |
unique_id, |
| 217 |
?, ?, ?, ?, ?, ?)"); |
221 |
opac_display, |
|
|
222 |
opac_editable, |
| 223 |
staff_searchable, |
| 224 |
authorised_value_category, |
| 225 |
display_checkout, |
| 226 |
category_code, |
| 227 |
class, |
| 228 |
code |
| 229 |
) |
| 230 |
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); |
| 218 |
} |
231 |
} |
|
|
232 |
|
| 219 |
$sth->execute( |
233 |
$sth->execute( |
| 220 |
$self->{description}, |
234 |
$self->{'description'}, |
| 221 |
$self->{repeatable}, |
235 |
$self->{'repeatable'}, |
| 222 |
$self->{unique_id}, |
236 |
$self->{'unique_id'}, |
| 223 |
$self->{opac_display}, |
237 |
$self->{'opac_display'}, |
| 224 |
$self->{staff_searchable}, |
238 |
$self->{'opac_editable'}, |
| 225 |
$self->{authorised_value_category}, |
239 |
$self->{'staff_searchable'} || 0, |
| 226 |
$self->{display_checkout}, |
240 |
$self->{'authorised_value_category'}, |
| 227 |
$self->{category_code} || undef, |
241 |
$self->{'display_checkout'}, |
| 228 |
$self->{class}, |
242 |
$self->{'category_code'} || undef, |
| 229 |
$self->{code}, |
243 |
$self->{'class'}, |
|
|
244 |
$self->{'code'} |
| 230 |
); |
245 |
); |
| 231 |
|
246 |
|
| 232 |
if ( defined $$self{branches} ) { |
247 |
if ( defined $$self{branches} ) { |
|
Lines 335-340
sub opac_display {
Link Here
|
| 335 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
350 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
| 336 |
} |
351 |
} |
| 337 |
|
352 |
|
|
|
353 |
=head2 opac_editable |
| 354 |
|
| 355 |
my $opac_editable = $attr_type->opac_editable(); |
| 356 |
$attr_type->opac_editable($opac_editable); |
| 357 |
|
| 358 |
Accessor. The C<$opac_editable> argument |
| 359 |
is interpreted as a Perl boolean. |
| 360 |
|
| 361 |
=cut |
| 362 |
|
| 363 |
sub opac_editable { |
| 364 |
my $self = shift; |
| 365 |
@_ ? $self->{'opac_editable'} = ((shift) ? 1 : 0) : $self->{'opac_editable'}; |
| 366 |
} |
| 367 |
|
| 338 |
=head2 staff_searchable |
368 |
=head2 staff_searchable |
| 339 |
|
369 |
|
| 340 |
my $staff_searchable = $attr_type->staff_searchable(); |
370 |
my $staff_searchable = $attr_type->staff_searchable(); |