Lines 38-43
C4::Members::AttributeTypes - mananage extended patron attribute types
Link Here
|
38 |
$attr_type->opac_display($opac_display); |
38 |
$attr_type->opac_display($opac_display); |
39 |
$attr_type->opac_editable($opac_editable); |
39 |
$attr_type->opac_editable($opac_editable); |
40 |
$attr_type->staff_searchable($staff_searchable); |
40 |
$attr_type->staff_searchable($staff_searchable); |
|
|
41 |
$attr_type->mandatory($mandatory); |
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(); |
43 |
$attr_type->delete(); |
44 |
$attr_type->delete(); |
Lines 108-113
sub new {
Link Here
|
108 |
$self->{'opac_display'} = 0; |
109 |
$self->{'opac_display'} = 0; |
109 |
$self->{'opac_editable'} = 0; |
110 |
$self->{'opac_editable'} = 0; |
110 |
$self->{'staff_searchable'} = 0; |
111 |
$self->{'staff_searchable'} = 0; |
|
|
112 |
$self->{'mandatory'} = 0; |
111 |
$self->{'display_checkout'} = 0; |
113 |
$self->{'display_checkout'} = 0; |
112 |
$self->{'authorised_value_category'} = ''; |
114 |
$self->{'authorised_value_category'} = ''; |
113 |
$self->{'category_code'} = ''; |
115 |
$self->{'category_code'} = ''; |
Lines 150-155
sub fetch {
Link Here
|
150 |
$self->{'opac_display'} = $row->{'opac_display'}; |
152 |
$self->{'opac_display'} = $row->{'opac_display'}; |
151 |
$self->{'opac_editable'} = $row->{'opac_editable'}; |
153 |
$self->{'opac_editable'} = $row->{'opac_editable'}; |
152 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
154 |
$self->{'staff_searchable'} = $row->{'staff_searchable'}; |
|
|
155 |
$self->{'mandatory'} = $row->{'mandatory'}; |
153 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
156 |
$self->{'display_checkout'} = $row->{'display_checkout'}; |
154 |
$self->{'authorised_value_category'} = $row->{'authorised_value_category'}; |
157 |
$self->{'authorised_value_category'} = $row->{'authorised_value_category'}; |
155 |
$self->{'category_code'} = $row->{'category_code'}; |
158 |
$self->{'category_code'} = $row->{'category_code'}; |
Lines 191-196
sub store {
Link Here
|
191 |
opac_display = ?, |
194 |
opac_display = ?, |
192 |
opac_editable = ?, |
195 |
opac_editable = ?, |
193 |
staff_searchable = ?, |
196 |
staff_searchable = ?, |
|
|
197 |
mandatory = ?, |
194 |
authorised_value_category = ?, |
198 |
authorised_value_category = ?, |
195 |
display_checkout = ?, |
199 |
display_checkout = ?, |
196 |
category_code = ?, |
200 |
category_code = ?, |
Lines 204-216
sub store {
Link Here
|
204 |
opac_display, |
208 |
opac_display, |
205 |
opac_editable, |
209 |
opac_editable, |
206 |
staff_searchable, |
210 |
staff_searchable, |
|
|
211 |
mandatory, |
207 |
authorised_value_category, |
212 |
authorised_value_category, |
208 |
display_checkout, |
213 |
display_checkout, |
209 |
category_code, |
214 |
category_code, |
210 |
class, |
215 |
class, |
211 |
code |
216 |
code |
212 |
) |
217 |
) |
213 |
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); |
218 |
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); |
214 |
} |
219 |
} |
215 |
|
220 |
|
216 |
$sth->execute( |
221 |
$sth->execute( |
Lines 220-225
sub store {
Link Here
|
220 |
$self->{'opac_display'}, |
225 |
$self->{'opac_display'}, |
221 |
$self->{'opac_editable'}, |
226 |
$self->{'opac_editable'}, |
222 |
$self->{'staff_searchable'} || 0, |
227 |
$self->{'staff_searchable'} || 0, |
|
|
228 |
$self->{'mandatory'} || 0, |
223 |
$self->{'authorised_value_category'}, |
229 |
$self->{'authorised_value_category'}, |
224 |
$self->{'display_checkout'}, |
230 |
$self->{'display_checkout'}, |
225 |
$self->{'category_code'} || undef, |
231 |
$self->{'category_code'} || undef, |
Lines 363-368
sub staff_searchable {
Link Here
|
363 |
@_ ? $self->{'staff_searchable'} = ((shift) ? 1 : 0) : $self->{'staff_searchable'}; |
369 |
@_ ? $self->{'staff_searchable'} = ((shift) ? 1 : 0) : $self->{'staff_searchable'}; |
364 |
} |
370 |
} |
365 |
|
371 |
|
|
|
372 |
=head2 mandatory |
373 |
|
374 |
my $mandatory = $attr_type->mandatory(); |
375 |
$attr_type->mandatory($mandatory); |
376 |
|
377 |
Accessor. The C<$mandatory> argument |
378 |
is interpreted as a Perl boolean. |
379 |
|
380 |
=cut |
381 |
|
382 |
sub mandatory { |
383 |
my $self = shift; |
384 |
@_ ? $self->{'mandatory'} = ((shift) ? 1 : 0) : $self->{'mandatory'}; |
385 |
} |
386 |
|
366 |
=head2 display_checkout |
387 |
=head2 display_checkout |
367 |
|
388 |
|
368 |
my $display_checkout = $attr_type->display_checkout(); |
389 |
my $display_checkout = $attr_type->display_checkout(); |