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

(-)a/C4/ILSDI/Services.pm (-1 / +1 lines)
Lines 476-482 sub GetPatronInfo { Link Here
476
    }
476
    }
477
477
478
    if ( $cgi->param('show_attributes') eq "1" ) {
478
    if ( $cgi->param('show_attributes') eq "1" ) {
479
        my $attrs = GetBorrowerAttributes( $borrowernumber, 0, 1 );
479
        my $attrs = GetBorrowerAttributes( $borrowernumber, 1 );
480
        $borrower->{'attributes'} = $attrs;
480
        $borrower->{'attributes'} = $attrs;
481
    }
481
    }
482
482
(-)a/t/db_dependent/ILSDI_Services.t (-10 / +26 lines)
Lines 140-151 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
140
    my $attr_type = $builder->build( {
140
    my $attr_type = $builder->build( {
141
        source => 'BorrowerAttributeType',
141
        source => 'BorrowerAttributeType',
142
        value  => {
142
        value  => {
143
            code                      => 'DOORCODE',
143
            code                      => 'HIDEME',
144
            opac_display              => 0,
144
            opac_display              => 0,
145
            authorised_value_category => '',
145
            authorised_value_category => '',
146
            class                     => '',
146
            class                     => '',
147
        }
147
        }
148
    } );
148
    } );
149
    my $attr_type_visible = $builder->build( {
150
        source => 'BorrowerAttributeType',
151
        value  => {
152
            code                      => 'SHOWME',
153
            opac_display              => 1,
154
            authorised_value_category => '',
155
            class                     => '',
156
        }
157
    } );
149
158
150
    # Create a new user:
159
    # Create a new user:
151
    my $brwr = $builder->build( {
160
    my $brwr = $builder->build( {
Lines 165-176 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
165
    } );
174
    } );
166
175
167
    # Set the new attribute for our user:
176
    # Set the new attribute for our user:
168
    my $attr = $builder->build( {
177
    my $attr_hidden = $builder->build( {
169
        source => 'BorrowerAttribute',
178
        source => 'BorrowerAttribute',
170
        value  => {
179
        value  => {
171
            borrowernumber => $brwr->{'borrowernumber'},
180
            borrowernumber => $brwr->{'borrowernumber'},
172
            code           => $attr_type->{'code'},
181
            code           => $attr_type->{'code'},
173
            attribute      => '1337',
182
            attribute      => '1337 hidden',
183
        }
184
    } );
185
    my $attr_shown = $builder->build( {
186
        source => 'BorrowerAttribute',
187
        value  => {
188
            borrowernumber => $brwr->{'borrowernumber'},
189
            code           => $attr_type_visible->{'code'},
190
            attribute      => '1337 shown',
174
        }
191
        }
175
    } );
192
    } );
176
193
Lines 196-207 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
196
213
197
    # Build a structure for comparison:
214
    # Build a structure for comparison:
198
    my $cmp = {
215
    my $cmp = {
199
        category_code     => $attr_type->{'category_code'},
216
        category_code     => $attr_type_visible->{'category_code'},
200
        class             => $attr_type->{'class'},
217
        class             => $attr_type_visible->{'class'},
201
        code              => $attr->{'code'},
218
        code              => $attr_shown->{'code'},
202
        description       => $attr_type->{'description'},
219
        description       => $attr_type_visible->{'description'},
203
        display_checkout  => $attr_type->{'display_checkout'},
220
        display_checkout  => $attr_type_visible->{'display_checkout'},
204
        value             => $attr->{'attribute'},
221
        value             => $attr_shown->{'attribute'},
205
        value_description => undef,
222
        value_description => undef,
206
    };
223
    };
207
224
208
- 

Return to bug 21199