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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-3 / +11 lines)
Lines 1004-1011 Link Here
1004
        [% END %]
1004
        [% END %]
1005
        <ol class="attributes_table">
1005
        <ol class="attributes_table">
1006
            [% FOREACH patron_attribute IN pa_loo.items %]
1006
            [% FOREACH patron_attribute IN pa_loo.items %]
1007
                <li data-category_code="[% patron_attribute.category_code %]">
1007
                [% IF patron_attribute.limited_to_another_branch %]
1008
                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1008
                    <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1009
                    <input type="hidden" id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" value="[% patron_attribute.value |html %]" />
1010
                    [% IF patron_attribute.password_allowed %]
1011
                        <input type="hidden" name="[% patron_attribute.form_id%]_password" value="[% patron_attribute.password %]" />
1012
                    [% END %]
1013
                [% ELSE %]
1014
                    <li data-category_code="[% patron_attribute.category_code %]">
1015
                        <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
1009
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1016
                        <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
1010
                        [% IF ( patron_attribute.use_dropdown ) %]
1017
                        [% IF ( patron_attribute.use_dropdown ) %]
1011
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
1018
                            <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
Lines 1033-1039 Link Here
1033
                        [% IF ( patron_attribute.repeatable ) %]
1040
                        [% IF ( patron_attribute.repeatable ) %]
1034
                        <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
1041
                        <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
1035
                        [% END %]
1042
                        [% END %]
1036
                </li>
1043
                    </li>
1044
                [% END %]
1037
            [% END %]
1045
            [% END %]
1038
        </ol>
1046
        </ol>
1039
        [% IF pa_loo.class %]</fieldset>[% END %]
1047
        [% IF pa_loo.class %]</fieldset>[% END %]
(-)a/members/memberentry.pl (-2 / +7 lines)
Lines 745-751 sub patron_attributes_form { Link Here
745
    my $template = shift;
745
    my $template = shift;
746
    my $borrowernumber = shift;
746
    my $borrowernumber = shift;
747
747
748
    my @types = C4::Members::AttributeTypes::GetAttributeTypes();
748
    my @types = C4::Members::AttributeTypes::GetAttributeTypes(1, 1);
749
    if (scalar(@types) == 0) {
749
    if (scalar(@types) == 0) {
750
        $template->param(no_patron_attribute_types => 1);
750
        $template->param(no_patron_attribute_types => 1);
751
        return;
751
        return;
Lines 763-770 sub patron_attributes_form { Link Here
763
    my @attribute_loop = ();
763
    my @attribute_loop = ();
764
    my $i = 0;
764
    my $i = 0;
765
    my %items_by_class;
765
    my %items_by_class;
766
    my $user_branch = C4::Context->userenv->{"branch"};
766
    foreach my $type_code (map { $_->{code} } @types) {
767
    foreach my $type_code (map { $_->{code} } @types) {
767
        my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
768
        my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
769
        my $limited_to_another_branch = 0;
770
        if ( my $branch_limitations = $attr_type->branches ) {
771
            $limited_to_another_branch = not grep { /^$user_branch$/ } @$branch_limitations;
772
        }
768
        my $entry = {
773
        my $entry = {
769
            class             => $attr_type->class(),
774
            class             => $attr_type->class(),
770
            code              => $attr_type->code(),
775
            code              => $attr_type->code(),
Lines 774-779 sub patron_attributes_form { Link Here
774
            category          => $attr_type->authorised_value_category(),
779
            category          => $attr_type->authorised_value_category(),
775
            category_code     => $attr_type->category_code(),
780
            category_code     => $attr_type->category_code(),
776
            password          => '',
781
            password          => '',
782
            limited_to_another_branch => $limited_to_another_branch,
777
        };
783
        };
778
        if (exists $attr_hash{$attr_type->code()}) {
784
        if (exists $attr_hash{$attr_type->code()}) {
779
            foreach my $attr (@{ $attr_hash{$attr_type->code()} }) {
785
            foreach my $attr (@{ $attr_hash{$attr_type->code()} }) {
780
- 

Return to bug 15165