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

(-)a/C4/Members/AttributeTypes.pm (-5 / +50 lines)
Lines 70-76 If $all_fields is true, then each hashref also contains the other fields from bo Link Here
70
70
71
sub GetAttributeTypes {
71
sub GetAttributeTypes {
72
    my ($all) = @_;
72
    my ($all) = @_;
73
    my $select = $all ? '*' : 'code, description';
73
    my $select = $all ? '*' : 'code, description, class';
74
    my $dbh = C4::Context->dbh;
74
    my $dbh = C4::Context->dbh;
75
    my $sth = $dbh->prepare("SELECT $select FROM borrower_attribute_types ORDER by code");
75
    my $sth = $dbh->prepare("SELECT $select FROM borrower_attribute_types ORDER by code");
76
    $sth->execute();
76
    $sth->execute();
Lines 120-125 sub new { Link Here
120
    $self->{'staff_searchable'} = 0;
120
    $self->{'staff_searchable'} = 0;
121
    $self->{'display_checkout'} = 0;
121
    $self->{'display_checkout'} = 0;
122
    $self->{'authorised_value_category'} = '';
122
    $self->{'authorised_value_category'} = '';
123
    $self->{'category_type'} = '';
124
    $self->{'class'} = '';
123
125
124
    bless $self, $class;
126
    bless $self, $class;
125
    return $self;
127
    return $self;
Lines 155-160 sub fetch { Link Here
155
    $self->{'staff_searchable'}          = $row->{'staff_searchable'};
157
    $self->{'staff_searchable'}          = $row->{'staff_searchable'};
156
    $self->{'display_checkout'}          = $row->{'display_checkout'};
158
    $self->{'display_checkout'}          = $row->{'display_checkout'};
157
    $self->{'authorised_value_category'} = $row->{'authorised_value_category'};
159
    $self->{'authorised_value_category'} = $row->{'authorised_value_category'};
160
    $self->{'category_type'}             = $row->{'category_type'};
161
    $self->{'class'}                     = $row->{'class'};
158
162
159
    bless $self, $class;
163
    bless $self, $class;
160
    return $self;
164
    return $self;
Lines 185-198 sub store { Link Here
185
                                         password_allowed = ?,
189
                                         password_allowed = ?,
186
                                         staff_searchable = ?,
190
                                         staff_searchable = ?,
187
                                         authorised_value_category = ?,
191
                                         authorised_value_category = ?,
188
                                         display_checkout = ?
192
                                         display_checkout = ?,
193
                                         category_type = ?,
194
                                         class = ?
189
                                     WHERE code = ?");
195
                                     WHERE code = ?");
190
    } else {
196
    } else {
191
        $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types 
197
        $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types 
192
                                        (description, repeatable, unique_id, opac_display, password_allowed,
198
                                        (description, repeatable, unique_id, opac_display, password_allowed,
193
                                         staff_searchable, authorised_value_category, display_checkout, code)
199
                                         staff_searchable, authorised_value_category, display_checkout, category_type, class, code)
194
                                        VALUES (?, ?, ?, ?, ?,
200
                                        VALUES (?, ?, ?, ?, ?,
195
                                                ?, ?, ?, ?)");
201
                                                ?, ?, ?, ?, ?, ?)");
196
    }
202
    }
197
    $sth->bind_param(1, $self->{'description'});
203
    $sth->bind_param(1, $self->{'description'});
198
    $sth->bind_param(2, $self->{'repeatable'});
204
    $sth->bind_param(2, $self->{'repeatable'});
Lines 202-208 sub store { Link Here
202
    $sth->bind_param(6, $self->{'staff_searchable'});
208
    $sth->bind_param(6, $self->{'staff_searchable'});
203
    $sth->bind_param(7, $self->{'authorised_value_category'});
209
    $sth->bind_param(7, $self->{'authorised_value_category'});
204
    $sth->bind_param(8, $self->{'display_checkout'});
210
    $sth->bind_param(8, $self->{'display_checkout'});
205
    $sth->bind_param(9, $self->{'code'});
211
    $sth->bind_param(9, $self->{'category_type'});
212
    $sth->bind_param(10, $self->{'class'});
213
    $sth->bind_param(11, $self->{'code'});
206
    $sth->execute;
214
    $sth->execute;
207
215
208
}
216
}
Lines 341-346 sub authorised_value_category { Link Here
341
    @_ ? $self->{'authorised_value_category'} = shift : $self->{'authorised_value_category'};
349
    @_ ? $self->{'authorised_value_category'} = shift : $self->{'authorised_value_category'};
342
}
350
}
343
351
352
=head2 category_type
353
354
=over 4
355
356
my $category_type = $attr_type->category_type();
357
$attr_type->category_type($category_type);
358
359
=back
360
361
Accessor.
362
363
=cut
364
365
sub category_type {
366
    my $self = shift;
367
    @_ ? $self->{'category_type'} = shift : $self->{'category_type'};
368
}
369
370
=head2 class
371
372
=over 4
373
374
my $category_type = $attr_type->class();
375
$attr_type->class($class);
376
377
=back
378
379
Accessor.
380
381
=cut
382
383
sub class {
384
    my $self = shift;
385
    @_ ? $self->{'class'} = shift : $self->{'class'};
386
}
387
388
344
=head2 delete
389
=head2 delete
345
390
346
  $attr_type->delete();
391
  $attr_type->delete();
(-)a/C4/Members/Attributes.pm (-1 / +3 lines)
Lines 72-78 sub GetBorrowerAttributes { Link Here
72
    my $opac_only = @_ ? shift : 0;
72
    my $opac_only = @_ ? shift : 0;
73
73
74
    my $dbh = C4::Context->dbh();
74
    my $dbh = C4::Context->dbh();
75
    my $query = "SELECT code, description, attribute, lib, password, display_checkout
75
    my $query = "SELECT code, description, attribute, lib, password, display_checkout, category_type, class
76
                 FROM borrower_attributes
76
                 FROM borrower_attributes
77
                 JOIN borrower_attribute_types USING (code)
77
                 JOIN borrower_attribute_types USING (code)
78
                 LEFT JOIN authorised_values ON (category = authorised_value_category AND attribute = authorised_value)
78
                 LEFT JOIN authorised_values ON (category = authorised_value_category AND attribute = authorised_value)
Lines 90-95 sub GetBorrowerAttributes { Link Here
90
            value_description => $row->{'lib'},  
90
            value_description => $row->{'lib'},  
91
            password          => $row->{'password'},
91
            password          => $row->{'password'},
92
            display_checkout  => $row->{'display_checkout'},
92
            display_checkout  => $row->{'display_checkout'},
93
            category_type     => $row->{'category_type'},
94
            class             => $row->{'class'},
93
        }
95
        }
94
    }
96
    }
95
    return \@results;
97
    return \@results;
(-)a/admin/patron-attr-types.pl (+9 lines)
Lines 110-115 sub error_add_attribute_type_form { Link Here
110
        $template->param(display_checkout_checked => 'checked="checked"');
110
        $template->param(display_checkout_checked => 'checked="checked"');
111
    }
111
    }
112
112
113
    $template->param( category_type => $input->param('category_type') );
114
    $template->param( class => $input->param('class') );
115
113
    $template->param(
116
    $template->param(
114
        attribute_type_form => 1,
117
        attribute_type_form => 1,
115
        confirm_op => 'add_attribute_type_confirmed',
118
        confirm_op => 'add_attribute_type_confirmed',
Lines 152-157 sub add_update_attribute_type { Link Here
152
    $attr_type->password_allowed($password_allowed);
155
    $attr_type->password_allowed($password_allowed);
153
    my $display_checkout = $input->param('display_checkout');
156
    my $display_checkout = $input->param('display_checkout');
154
    $attr_type->display_checkout($display_checkout);
157
    $attr_type->display_checkout($display_checkout);
158
    $attr_type->category_type($input->param('category_type'));
159
    $attr_type->class($input->param('class'));
155
160
156
    if ($op eq 'edit') {
161
    if ($op eq 'edit') {
157
        $template->param(edited_attribute_type => $attr_type->code());
162
        $template->param(edited_attribute_type => $attr_type->code());
Lines 209-214 sub edit_attribute_type_form { Link Here
209
214
210
    $template->param(code => $code);
215
    $template->param(code => $code);
211
    $template->param(description => $attr_type->description());
216
    $template->param(description => $attr_type->description());
217
    $template->param(class => $attr_type->class());
212
218
213
    if ($attr_type->repeatable()) {
219
    if ($attr_type->repeatable()) {
214
        $template->param(repeatable_checked => 1);
220
        $template->param(repeatable_checked => 1);
Lines 232-237 sub edit_attribute_type_form { Link Here
232
    }
238
    }
233
    authorised_value_category_list($template, $attr_type->authorised_value_category());
239
    authorised_value_category_list($template, $attr_type->authorised_value_category());
234
240
241
    $template->param ( category_type => $attr_type->category_type );
242
    $template->param ( class => $attr_type->class );
243
235
    $template->param(
244
    $template->param(
236
        attribute_type_form => 1,
245
        attribute_type_form => 1,
237
        edit_attribute_type => 1,
246
        edit_attribute_type => 1,
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 286-291 CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field Link Here
286
  `staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no)
286
  `staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no)
287
  `authorised_value_category` varchar(10) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category
287
  `authorised_value_category` varchar(10) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category
288
  `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens
288
  `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens
289
  `category_type` VARCHAR(1) NOT NULL DEFAULT '',-- defines a category for an attribute_type
290
  `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
289
  PRIMARY KEY  (`code`),
291
  PRIMARY KEY  (`code`),
290
  KEY `auth_val_cat_idx` (`authorised_value_category`)
292
  KEY `auth_val_cat_idx` (`authorised_value_category`)
291
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
293
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4571-4576 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4571
    SetVersion($DBversion);
4571
    SetVersion($DBversion);
4572
}
4572
}
4573
4573
4574
$DBversion = "3.06.00.XXX";
4575
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4576
    $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN category_type VARCHAR(1)  NOT NULL DEFAULT '' AFTER `display_checkout`");
4577
    $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN class VARCHAR(255)  NOT NULL DEFAULT '' AFTER `category_type`");
4578
    print "Upgrade to $DBversion done (New fields category_type and class in borrower_attribute_types table)\n";
4579
    SetVersion($DBversion);
4580
}
4574
4581
4575
=head1 FUNCTIONS
4582
=head1 FUNCTIONS
4576
4583
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-17 / +45 lines)
Lines 186-191 function CheckAttributeTypeForm(f) { Link Here
186
                  to be chosen from the authorized value list.  However, an authorized value list is not 
186
                  to be chosen from the authorized value list.  However, an authorized value list is not 
187
                  enforced during batch patron import.</span>
187
                  enforced during batch patron import.</span>
188
        </li>
188
        </li>
189
        <li>
190
            <label for="category_type">Category type: </label>
191
            <select name="category_type" id="category_type">
192
                <option value=""></option>
193
                [% IF category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
194
                [% IF category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
195
                [% IF category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
196
                [% IF category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
197
                [% IF category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
198
                [% IF category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
199
            </select>
200
            <span>Please let blank if you want these attributs to be for all types of patron. Else, select one type.</span>
201
        </li>
202
        <li>
203
            <label for="class">Class: </label>
204
            <input type="text" id="class" name="class"  size="20" value="[% class | html %]"/>
205
            <span>Group attributes types with a block title</span>
206
        </li>
189
    </ol>
207
    </ol>
190
  </fieldset>
208
  </fieldset>
191
  <fieldset class="action">
209
  <fieldset class="action">
Lines 248-270 function CheckAttributeTypeForm(f) { Link Here
248
<div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_not_found %]&quot; 
266
<div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_not_found %]&quot; 
249
    &mdash; it was already absent from the database.</div>
267
    &mdash; it was already absent from the database.</div>
250
[% END %]
268
[% END %]
251
[% IF ( available_attribute_types ) %]<table>
269
[% IF ( available_attribute_types ) %]
252
  <tr>
270
  <table id="patron_attributes_types">
253
    <th>Code</th>
271
    <thead>
254
    <th>Description</th>
272
      <tr>
255
    <th>Actions</th>
273
        <th>Class</th>
256
  </tr>
274
        <th>Code</th>
257
  [% FOREACH available_attribute_type IN available_attribute_types %]
275
        <th>Description</th>
258
  <tr>
276
        <th>Actions</th>
259
    <td>[% available_attribute_type.code |html %]</td>
277
      </tr>
260
    <td>[% available_attribute_type.description %]</td>
278
    </thead>
261
    <td>
279
    <tbody>
262
      <a href="[% available_attribute_type.script_name %]?op=edit_attribute_type&amp;code=[% available_attribute_type.code |html %]">Edit</a>
280
      [% FOREACH available_attribute_type IN available_attribute_types %]
263
      <a href="[% available_attribute_type.script_name %]?op=delete_attribute_type&amp;code=[% available_attribute_type.code |html %]">Delete</a>
281
        <tr>
264
    </td>
282
          <td>[% available_attribute_type.class |html %]</td>
265
  </tr>
283
          <td>[% available_attribute_type.code |html %]</td>
266
  [% END %]
284
          <td>[% available_attribute_type.description %]</td>
267
</table>[% ELSE %]<p>There are no saved patron attribute types.</p>[% END %]
285
          <td>
286
            <a href="[% available_attribute_type.script_name %]?op=edit_attribute_type&amp;code=[% available_attribute_type.code |html %]">Edit</a>
287
            <a href="[% available_attribute_type.script_name %]?op=delete_attribute_type&amp;code=[% available_attribute_type.code |html %]">Delete</a>
288
          </td>
289
        </tr>
290
      [% END %]
291
    </tbody>
292
  </table>
293
[% ELSE %]
294
  <p>There are no saved patron attribute types.</p>
295
[% END %]
268
296
269
<div class="pages">[% pagination_bar %]</div>
297
<div class="pages">[% pagination_bar %]</div>
270
298
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-25 / +59 lines)
Lines 23-28 Link Here
23
            document.form.state.value=RegExp.$3;
23
            document.form.state.value=RegExp.$3;
24
            document.form.country.value=RegExp.$4;
24
            document.form.country.value=RegExp.$4;
25
        });
25
        });
26
27
        [% IF category_type %]
28
            update_category_code( "[% category_type %]" );
29
        [% ELSE %]
30
            if ( $("#categorycode").length > 0 ){
31
                var category_type = $("#categorycode").find("option:selected").attr("data-typename");
32
                update_category_code( category_type );
33
            }
34
        [% END %]
35
26
    });
36
    });
27
37
28
    function clear_entry(node) {
38
    function clear_entry(node) {
Lines 51-56 Link Here
51
        $("select#patron_attr_" + newId, clone).attr('value','');
61
        $("select#patron_attr_" + newId, clone).attr('value','');
52
        original.parentNode.insertBefore(clone, original.nextSibling);
62
        original.parentNode.insertBefore(clone, original.nextSibling);
53
    }
63
    }
64
65
    function update_category_code(category_type) {
66
        var mytable = $("#attributes_table>tbody");
67
68
        mytable.find("tr").each(function(){
69
            $(this).hide()
70
        });
71
72
        mytable.find("tr[data-category_type="+category_type+"]").each(function(){
73
            $(this).show();
74
        });
75
        mytable.find("tr[data-category_type='']").each(function(){
76
            $(this).show();
77
        });
78
79
    }
80
54
		var MSG_SEPARATOR = _("Separator must be / in field ");
81
		var MSG_SEPARATOR = _("Separator must be / in field ");
55
        var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
82
        var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
56
        var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
83
        var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
Lines 890-914 Link Here
890
    </li>
917
    </li>
891
    <li>
918
    <li>
892
        <label for="categorycode">Category: </label>
919
        <label for="categorycode">Category: </label>
893
        <select id="categorycode" name="categorycode">
920
        <select id="categorycode" name="categorycode" onchange="update_category_code(this);">
894
        [% FOREACH typeloo IN typeloop %]
921
        [% FOREACH typeloo IN typeloop %]
895
			[% FOREACH categoryloo IN typeloo.categoryloop %]
922
            [% FOREACH categoryloo IN typeloo.categoryloop %]
896
				[% IF ( loop.first ) %]
923
                [% IF ( loop.first ) %]
897
					[% IF ( categoryloo.typename_C ) %]<optgroup label="Child">[% END %]
924
                    [% IF ( categoryloo.typename_C ) %]<optgroup label="Child"        value="C">[% END %]
898
					[% IF ( categoryloo.typename_A ) %]<optgroup label="Adult">[% END %]
925
                    [% IF ( categoryloo.typename_A ) %]<optgroup label="Adult"        value="A">[% END %]
899
					[% IF ( categoryloo.typename_S ) %]<optgroup label="Staff">[% END %]
926
                    [% IF ( categoryloo.typename_S ) %]<optgroup label="Staff"        value="S">[% END %]
900
					[% IF ( categoryloo.typename_I ) %]<optgroup label="Organization">[% END %]
927
                    [% IF ( categoryloo.typename_I ) %]<optgroup label="Organization" value="I">[% END %]
901
					[% IF ( categoryloo.typename_P ) %]<optgroup label="Professional">[% END %]
928
                    [% IF ( categoryloo.typename_P ) %]<optgroup label="Professional" value="P">[% END %]
902
					[% IF ( categoryloo.typename_X ) %]<optgroup label="Statistical">[% END %]
929
                    [% IF ( categoryloo.typename_X ) %]<optgroup label="Statistical"  value="X">[% END %]
903
			    [% END %]
930
                [% END %]
904
				[% IF ( categoryloo.categorycodeselected ) %]
931
                [% IF ( categoryloo.categorycodeselected ) %]
905
               <option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.categoryname %]</option>
932
                    <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
906
				[% ELSE %]
933
                [% ELSE %]
907
<option value="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</option>
934
                    <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
908
				[% END %]
935
                [% END %]
909
				[% IF ( loop.last ) %]
936
                [% IF ( loop.last ) %]
910
			        </optgroup>
937
                    </optgroup>
911
				[% END %]
938
                [% END %]
912
            [% END %]
939
            [% END %]
913
       [% END %]
940
       [% END %]
914
       </select>
941
       </select>
Lines 1180-1193 Link Here
1180
  <fieldset class="rows" id="memberentry_patron_attributes">
1207
  <fieldset class="rows" id="memberentry_patron_attributes">
1181
    <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1208
    <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1182
    <legend>Additional attributes and identifiers</legend>
1209
    <legend>Additional attributes and identifiers</legend>
1183
    <table>
1210
    <table id="attributes_table">
1184
        <tr>
1211
        <thead>
1185
            <th>Type</th>
1212
            <tr>
1186
            <th colspan="2">Value</th>
1213
                <th>Class</th>
1187
        </tr>
1214
                <th>Type</th>
1215
                <th colspan="2">Value</th>
1216
            </tr>
1217
        </thead>
1218
        <tbody>
1188
        [% FOREACH patron_attribute IN patron_attributes %]
1219
        [% FOREACH patron_attribute IN patron_attributes %]
1189
        <tr>
1220
        <tr data-category_type="[% patron_attribute.category_type %]">
1190
            <td>[% patron_attribute.code %] ([% patron_attribute.description %])
1221
            <td>[% patron_attribute.class %]</td>
1222
            <td>
1223
                [% patron_attribute.code %] ([% patron_attribute.description %])
1191
            </td>
1224
            </td>
1192
            <td>
1225
            <td>
1193
                <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1226
                <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
Lines 1228-1233 Link Here
1228
            </td>
1261
            </td>
1229
        </tr>
1262
        </tr>
1230
        [% END %]
1263
        [% END %]
1264
        </tbody>
1231
    </table>
1265
    </table>
1232
  </fieldset>
1266
  </fieldset>
1233
[% END %][% END %][% END %]
1267
[% END %][% END %][% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-15 / +28 lines)
Lines 285-306 function validate1(date) { Link Here
285
[% UNLESS ( no_patron_attribute_types ) %]
285
[% UNLESS ( no_patron_attribute_types ) %]
286
<div id="patron-extended-attributes" style="padding-top: 1em;">
286
<div id="patron-extended-attributes" style="padding-top: 1em;">
287
<h3>Additional attributes and identifiers</h3>
287
<h3>Additional attributes and identifiers</h3>
288
<table>
288
[% FOREACH attribute IN attributes_loop %]
289
    <tr>
289
    [% IF attribute.class %]
290
        <th>Type</th>
290
        <h4>[% attribute.class %]</h4>
291
        <th>Value</th>
291
        <table id=aai_[% attribute.class %]>
292
    </tr>
292
    [% ELSE %]
293
    [% FOREACH extendedattribute IN extendedattributes %]
293
        <table id="aai">
294
    <tr>
295
        <td>[% extendedattribute.code %] ([% extendedattribute.description %])</td>
296
        <td>[% extendedattribute.value %]
297
            [% IF ( extendedattribute.value_description ) %]
298
                ([% extendedattribute.value_description %])
299
            [% END %]
300
        </td>
301
    </tr>
302
    [% END %]
294
    [% END %]
303
</table>
295
        <thead>
296
            <tr>
297
                <th>Type</th>
298
                <th>Description</th>
299
                <th>Value</th>
300
            </tr>
301
        </thead>
302
        <tbody>
303
        [% FOREACH item IN attribute.items %]
304
            <tr>
305
                <td>[% item.code %]</td>
306
                <td>[% item.description %]</td>
307
                <td>[% item.value %]
308
                    [% IF ( item.value_description ) %]
309
                        ([% item.value_description %])
310
                    [% END %]
311
                </td>
312
            </tr>
313
        [% END %]
314
        </tbody>
315
    </table>
316
[% END %]
304
</div>
317
</div>
305
<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=4">Edit</a></div>
318
<div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=4">Edit</a></div>
306
[% END %]
319
[% END %]
(-)a/members/memberentry.pl (+5 lines)
Lines 407-412 if ($op eq 'add'){ Link Here
407
if ($op eq "modify")  {
407
if ($op eq "modify")  {
408
    $template->param( updtype => 'M',modify => 1 );
408
    $template->param( updtype => 'M',modify => 1 );
409
    $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1) unless $step;
409
    $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1) unless $step;
410
    if ( $step = 4 ) {
411
        $template->param( category_type => $borrower_data->{'categorycode'} );
412
    }
410
}
413
}
411
if ( $op eq "duplicate" ) {
414
if ( $op eq "duplicate" ) {
412
    $template->param( updtype => 'I' );
415
    $template->param( updtype => 'I' );
Lines 760-770 sub patron_attributes_form { Link Here
760
    foreach my $type_code (map { $_->{code} } @types) {
763
    foreach my $type_code (map { $_->{code} } @types) {
761
        my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
764
        my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
762
        my $entry = {
765
        my $entry = {
766
            class             => $attr_type->class(),
763
            code              => $attr_type->code(),
767
            code              => $attr_type->code(),
764
            description       => $attr_type->description(),
768
            description       => $attr_type->description(),
765
            repeatable        => $attr_type->repeatable(),
769
            repeatable        => $attr_type->repeatable(),
766
            password_allowed  => $attr_type->password_allowed(),
770
            password_allowed  => $attr_type->password_allowed(),
767
            category          => $attr_type->authorised_value_category(),
771
            category          => $attr_type->authorised_value_category(),
772
            category_type     => $attr_type->category_type(),
768
            password          => '',
773
            password          => '',
769
        };
774
        };
770
        if (exists $attr_hash{$attr_type->code()}) {
775
        if (exists $attr_hash{$attr_type->code()}) {
(-)a/members/moremember.pl (-4 / +16 lines)
Lines 252-258 my $issuecount = @{$issue}; Link Here
252
my $relissuecount  = @{$relissue};
252
my $relissuecount  = @{$relissue};
253
my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
253
my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
254
my $today       = POSIX::strftime("%Y-%m-%d", localtime);	# iso format
254
my $today       = POSIX::strftime("%Y-%m-%d", localtime);	# iso format
255
my @issuedata;
256
my @borrowers_with_issues;
255
my @borrowers_with_issues;
257
my $overdues_exist = 0;
256
my $overdues_exist = 0;
258
my $totalprice = 0;
257
my $totalprice = 0;
Lines 432-442 my $branch=C4::Context->userenv->{'branch'}; Link Here
432
$template->param(%$data);
431
$template->param(%$data);
433
432
434
if (C4::Context->preference('ExtendedPatronAttributes')) {
433
if (C4::Context->preference('ExtendedPatronAttributes')) {
435
    my $attributes = GetBorrowerAttributes($borrowernumber);
434
    my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
435
    my @classes = uniq( map {$_->{class}} @$attributes );
436
    my @attributes_loop;
437
    for my $class (@classes) {
438
        my @items;
439
        for my $attr (@$attributes) {
440
            push @items, $attr if $attr->{class} eq $class
441
        }
442
        push @attributes_loop, {
443
            class => $class,
444
            items => \@items
445
        };
446
    }
447
436
    $template->param(
448
    $template->param(
437
        ExtendedPatronAttributes => 1,
449
        ExtendedPatronAttributes => 1,
438
        extendedattributes => $attributes
450
        attributes_loop => \@attributes_loop
439
    );
451
    );
452
440
    my @types = C4::Members::AttributeTypes::GetAttributeTypes();
453
    my @types = C4::Members::AttributeTypes::GetAttributeTypes();
441
    if (scalar(@types) == 0) {
454
    if (scalar(@types) == 0) {
442
        $template->param(no_patron_attribute_types => 1);
455
        $template->param(no_patron_attribute_types => 1);
443
- 

Return to bug 7154