View | Details | Raw Unified | Return to bug 22844
Collapse All | Expand All

(-)a/C4/Members/AttributeTypes.pm (-1 / +22 lines)
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();
(-)a/admin/patron-attr-types.pl (+8 lines)
Lines 125-130 sub error_add_attribute_type_form { Link Here
125
    if ($input->param('staff_searchable')) {
125
    if ($input->param('staff_searchable')) {
126
        $template->param(staff_searchable_checked => 1);
126
        $template->param(staff_searchable_checked => 1);
127
    }
127
    }
128
    if ($input->param('mandatory')) {
129
        $template->param(mandatory_checked => 1);
130
    }
128
    if ($input->param('display_checkout')) {
131
    if ($input->param('display_checkout')) {
129
        $template->param(display_checkout_checked => 'checked="checked"');
132
        $template->param(display_checkout_checked => 'checked="checked"');
130
    }
133
    }
Lines 170-175 sub add_update_attribute_type { Link Here
170
    $attr_type->opac_editable($opac_editable);
173
    $attr_type->opac_editable($opac_editable);
171
    my $staff_searchable = $input->param('staff_searchable');
174
    my $staff_searchable = $input->param('staff_searchable');
172
    $attr_type->staff_searchable($staff_searchable);
175
    $attr_type->staff_searchable($staff_searchable);
176
    my $mandatory = $input->param('mandatory');
177
    $attr_type->mandatory($mandatory);
173
    my $authorised_value_category = $input->param('authorised_value_category');
178
    my $authorised_value_category = $input->param('authorised_value_category');
174
    $attr_type->authorised_value_category($authorised_value_category);
179
    $attr_type->authorised_value_category($authorised_value_category);
175
    my $display_checkout = $input->param('display_checkout');
180
    my $display_checkout = $input->param('display_checkout');
Lines 254-259 sub edit_attribute_type_form { Link Here
254
    if ($attr_type->staff_searchable()) {
259
    if ($attr_type->staff_searchable()) {
255
        $template->param(staff_searchable_checked => 1);
260
        $template->param(staff_searchable_checked => 1);
256
    }
261
    }
262
    if ($attr_type->mandatory()) {
263
        $template->param(mandatory_checked => 1);
264
    }
257
    if ($attr_type->display_checkout()) {
265
    if ($attr_type->display_checkout()) {
258
        $template->param(display_checkout_checked => 'checked="checked"');
266
        $template->param(display_checkout_checked => 'checked="checked"');
259
    }
267
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-1 / +8 lines)
Lines 132-137 Link Here
132
          [% END %]
132
          [% END %]
133
            <span>Check to make this attribute staff_searchable in the staff patron search.</span>
133
            <span>Check to make this attribute staff_searchable in the staff patron search.</span>
134
       </li>
134
       </li>
135
       <li><label for="mandatory">Mandatory: </label>
136
          [% IF ( mandatory_checked ) %]
137
            <input type="checkbox" id="mandatory" name="mandatory" checked="checked" />
138
          [% ELSE %]
139
            <input type="checkbox" id="mandatory" name="mandatory" />
140
          [% END %]
141
            <span>Check to make this attribute mandatory when creating or editing a patron.</span>
142
       </li>
135
       <li><label for="display_checkout">Display in check-out: </label>
143
       <li><label for="display_checkout">Display in check-out: </label>
136
            [% IF display_checkout_checked %]
144
            [% IF display_checkout_checked %]
137
                <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
145
                <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
138
- 

Return to bug 22844