|
Lines 42-47
C4::Members::AttributeTypes - mananage extended patron attribute types
Link Here
|
| 42 |
$attr_type->repeatable($repeatable); |
42 |
$attr_type->repeatable($repeatable); |
| 43 |
$attr_type->unique_id($unique_id); |
43 |
$attr_type->unique_id($unique_id); |
| 44 |
$attr_type->opac_display($opac_display); |
44 |
$attr_type->opac_display($opac_display); |
|
|
45 |
$attr_type->opac_editable($opac_editable); |
| 45 |
$attr_type->password_allowed($password_allowed); |
46 |
$attr_type->password_allowed($password_allowed); |
| 46 |
$attr_type->staff_searchable($staff_searchable); |
47 |
$attr_type->staff_searchable($staff_searchable); |
| 47 |
$attr_type->authorised_value_category($authorised_value_category); |
48 |
$attr_type->authorised_value_category($authorised_value_category); |
|
Lines 128-133
sub new {
Link Here
|
| 128 |
$self->{'repeatable'} = 0; |
129 |
$self->{'repeatable'} = 0; |
| 129 |
$self->{'unique_id'} = 0; |
130 |
$self->{'unique_id'} = 0; |
| 130 |
$self->{'opac_display'} = 0; |
131 |
$self->{'opac_display'} = 0; |
|
|
132 |
$self->{'opac_editable'} = 0; |
| 131 |
$self->{'password_allowed'} = 0; |
133 |
$self->{'password_allowed'} = 0; |
| 132 |
$self->{'staff_searchable'} = 0; |
134 |
$self->{'staff_searchable'} = 0; |
| 133 |
$self->{'display_checkout'} = 0; |
135 |
$self->{'display_checkout'} = 0; |
|
Lines 170-175
sub fetch {
Link Here
|
| 170 |
$self->{'repeatable'} = $row->{'repeatable'}; |
172 |
$self->{'repeatable'} = $row->{'repeatable'}; |
| 171 |
$self->{'unique_id'} = $row->{'unique_id'}; |
173 |
$self->{'unique_id'} = $row->{'unique_id'}; |
| 172 |
$self->{'opac_display'} = $row->{'opac_display'}; |
174 |
$self->{'opac_display'} = $row->{'opac_display'}; |
|
|
175 |
$self->{'opac_editable'} = $row->{'opac_editable'}; |
| 173 |
$self->{'password_allowed'} = $row->{'password_allowed'}; |
176 |
$self->{'password_allowed'} = $row->{'password_allowed'}; |
| 174 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
177 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
| 175 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
178 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
|
Lines 211-216
sub store {
Link Here
|
| 211 |
repeatable = ?, |
214 |
repeatable = ?, |
| 212 |
unique_id = ?, |
215 |
unique_id = ?, |
| 213 |
opac_display = ?, |
216 |
opac_display = ?, |
|
|
217 |
opac_editable = ?, |
| 214 |
password_allowed = ?, |
218 |
password_allowed = ?, |
| 215 |
staff_searchable = ?, |
219 |
staff_searchable = ?, |
| 216 |
authorised_value_category = ?, |
220 |
authorised_value_category = ?, |
|
Lines 220-226
sub store {
Link Here
|
| 220 |
WHERE code = ?"); |
224 |
WHERE code = ?"); |
| 221 |
} else { |
225 |
} else { |
| 222 |
$sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types |
226 |
$sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types |
| 223 |
(description, repeatable, unique_id, opac_display, password_allowed, |
227 |
(description, repeatable, unique_id, opac_display, opac_editable, password_allowed, |
| 224 |
staff_searchable, authorised_value_category, display_checkout, category_code, class, code) |
228 |
staff_searchable, authorised_value_category, display_checkout, category_code, class, code) |
| 225 |
VALUES (?, ?, ?, ?, ?, |
229 |
VALUES (?, ?, ?, ?, ?, |
| 226 |
?, ?, ?, ?, ?, ?)"); |
230 |
?, ?, ?, ?, ?, ?)"); |
|
Lines 229-241
sub store {
Link Here
|
| 229 |
$sth->bind_param(2, $self->{'repeatable'}); |
233 |
$sth->bind_param(2, $self->{'repeatable'}); |
| 230 |
$sth->bind_param(3, $self->{'unique_id'}); |
234 |
$sth->bind_param(3, $self->{'unique_id'}); |
| 231 |
$sth->bind_param(4, $self->{'opac_display'}); |
235 |
$sth->bind_param(4, $self->{'opac_display'}); |
| 232 |
$sth->bind_param(5, $self->{'password_allowed'}); |
236 |
$sth->bind_param(5, $self->{'opac_editable'}); |
| 233 |
$sth->bind_param(6, $self->{'staff_searchable'}); |
237 |
$sth->bind_param(6, $self->{'password_allowed'}); |
| 234 |
$sth->bind_param(7, $self->{'authorised_value_category'}); |
238 |
$sth->bind_param(7, $self->{'staff_searchable'}); |
| 235 |
$sth->bind_param(8, $self->{'display_checkout'}); |
239 |
$sth->bind_param(8, $self->{'authorised_value_category'}); |
| 236 |
$sth->bind_param(9, $self->{'category_code'} || undef); |
240 |
$sth->bind_param(9, $self->{'display_checkout'}); |
| 237 |
$sth->bind_param(10, $self->{'class'}); |
241 |
$sth->bind_param(10, $self->{'category_code'} || undef); |
| 238 |
$sth->bind_param(11, $self->{'code'}); |
242 |
$sth->bind_param(11, $self->{'class'}); |
|
|
243 |
$sth->bind_param(12, $self->{'code'}); |
| 239 |
$sth->execute; |
244 |
$sth->execute; |
| 240 |
|
245 |
|
| 241 |
if ( defined $$self{branches} ) { |
246 |
if ( defined $$self{branches} ) { |
|
Lines 342-347
sub opac_display {
Link Here
|
| 342 |
my $self = shift; |
347 |
my $self = shift; |
| 343 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
348 |
@_ ? $self->{'opac_display'} = ((shift) ? 1 : 0) : $self->{'opac_display'}; |
| 344 |
} |
349 |
} |
|
|
350 |
=head2 opac_editable |
| 351 |
|
| 352 |
my $opac_editable = $attr_type->opac_editable(); |
| 353 |
$attr_type->opac_editable($opac_editable); |
| 354 |
|
| 355 |
Accessor. The C<$opac_editable> argument |
| 356 |
is interpreted as a Perl boolean. |
| 357 |
|
| 358 |
=cut |
| 359 |
|
| 360 |
sub opac_editable { |
| 361 |
my $self = shift; |
| 362 |
@_ ? $self->{'opac_editable'} = ((shift) ? 1 : 0) : $self->{'opac_editable'}; |
| 363 |
} |
| 345 |
=head2 password_allowed |
364 |
=head2 password_allowed |
| 346 |
|
365 |
|
| 347 |
my $password_allowed = $attr_type->password_allowed(); |
366 |
my $password_allowed = $attr_type->password_allowed(); |