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

(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (+4 lines)
Lines 152-157 label input[type="radio"], Link Here
152
    font-weight : bold;
152
    font-weight : bold;
153
}
153
}
154
154
155
.members-update-table {
156
    padding-top: 10px;
157
}
158
155
#navmenulist li {
159
#navmenulist li {
156
	padding : .2em 0;
160
	padding : .2em 0;
157
    list-style-image : url("../img/arrow-bullet.gif");
161
    list-style-image : url("../img/arrow-bullet.gif");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (-6 / +43 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% USE Branches %]
2
[% USE Branches %]
2
[% USE Categories %]
3
[% USE Categories %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
Lines 68-75 Link Here
68
[% END %]
69
[% END %]
69
70
70
[% BLOCK display_extended_attributes %]
71
[% BLOCK display_extended_attributes %]
71
    [% FOREACH attr IN attributes %]
72
    [% IF attrs and attrs.size > 1 %]
72
        <span>[% attr.code %]: [% IF pending %][% attr.value %][% ELSE %][% attr.attribute %][% END %]</span><br/>
73
      <ul>
74
        [% FOREACH attr IN attrs %]
75
            <li>[% PROCESS display_attribute attr=attr type=type %]</li>
76
        [% END %]
77
      <ul>
78
    [% ELSIF attrs %]
79
        [% PROCESS display_attribute attr=attrs.0 type=type %]
80
    [% END %]
81
[% END %]
82
83
[% BLOCK display_attribute %]
84
    [% IF type.authorised_value_category %]
85
        [% AuthorisedValues.GetByCode(type.authorised_value_category,attr.attribute) %]
86
    [% ELSE %]
87
        [% attr.attribute %]
73
    [% END %]
88
    [% END %]
74
[% END %]
89
[% END %]
75
90
Lines 99-104 Link Here
99
                                        <label for="ignore_modify_[% pm.borrowernumber %]">Ignore</label>
114
                                        <label for="ignore_modify_[% pm.borrowernumber %]">Ignore</label>
100
                                        | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber %]" >Patron details</a>
115
                                        | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber %]" >Patron details</a>
101
                                    </div>
116
                                    </div>
117
                                  [% IF !pm.extended_attributes and pm.size > 3 or
118
                                         pm.extended_attributes and pm.size > 4  %]
119
                                  [%# timestamp+verification_token+borrowernumber=3 %]
120
                                    <div class="members-update-table">
102
                                        <table>
121
                                        <table>
103
                                            <tr>
122
                                            <tr>
104
                                                <th>Field</th>
123
                                                <th>Field</th>
Lines 108-114 Link Here
108
127
109
128
110
                                            [% FOREACH key IN pm.keys %]
129
                                            [% FOREACH key IN pm.keys %]
111
                                                [% IF ( key != "timestamp" ) %]
130
                                                [% IF ( key != "timestamp" and key != "extended_attributes" ) %]
112
                                                    [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
131
                                                    [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
113
                                                        <tr>
132
                                                        <tr>
114
                                                            <td>[% PROCESS display_names field = key %]</td>
133
                                                            <td>[% PROCESS display_names field = key %]</td>
Lines 118-126 Link Here
118
                                                            [% ELSIF key == 'branchcode' %]
137
                                                            [% ELSIF key == 'branchcode' %]
119
                                                                <td>[% Branches.GetName( borrowers.$borrowernumber.$key )  %]</td>
138
                                                                <td>[% Branches.GetName( borrowers.$borrowernumber.$key )  %]</td>
120
                                                                <td>[% Branches.GetName( pm.$key ) %]</td>
139
                                                                <td>[% Branches.GetName( pm.$key ) %]</td>
121
                                                            [% ELSIF ( key == 'extended_attributes' ) %]
122
                                                                <td>[% PROCESS display_extended_attributes attributes=borrowers.$borrowernumber.$key %]</td>
123
                                                                <td>[% PROCESS display_extended_attributes attributes=pm.$key pending=1 %]</td>
124
                                                            [% ELSE %]
140
                                                            [% ELSE %]
125
                                                                <td>[% borrowers.$borrowernumber.$key %]</td>
141
                                                                <td>[% borrowers.$borrowernumber.$key %]</td>
126
                                                                <td>[% pm.$key %]</td>
142
                                                                <td>[% pm.$key %]</td>
Lines 130-135 Link Here
130
                                                [% END %]
146
                                                [% END %]
131
                                            [% END %]
147
                                            [% END %]
132
                                        </table>
148
                                        </table>
149
                                    </div>
150
                                  [%  END %]
151
                                  [% IF borrowers.$borrowernumber.modified_attributes %]
152
                                    <div class="members-update-table">
153
                                        <h4>[% PROCESS display_names field='extended_attributes' %]</h4>
154
                                        <table>
155
                                            <tr>
156
                                                <th>Field</th>
157
                                                <th>Old value</th>
158
                                                <th>New value</th>
159
                                            </tr>
160
                                          [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %]
161
                                            <tr>
162
                                                <td>[% attribute_group.type.description %]</td>
163
                                                <td>[% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %]</td>
164
                                                <td>[% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]</td>
165
                                            </tr>
166
                                          [% END %]
167
                                        </table>
168
                                    </div>
169
                                  [%  END %]
133
                                </div>
170
                                </div>
134
                            [% END %]
171
                            [% END %]
135
                        </div>
172
                        </div>
(-)a/members/members-update.pl (-19 / +26 lines)
Lines 24-37 use C4::Auth; Link Here
24
use C4::Output;
24
use C4::Output;
25
use C4::Context;
25
use C4::Context;
26
use C4::Members;
26
use C4::Members;
27
use Koha::Patron::Attribute::Types;
27
use Koha::Patron::Attributes;
28
use Koha::Patron::Attributes;
28
use Koha::Patron::Modifications;
29
use Koha::Patron::Modifications;
30
use Koha::Patrons;
31
32
use List::MoreUtils qw( uniq );
29
33
30
my $query = new CGI;
34
my $query = new CGI;
31
35
32
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
36
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
33
    {
37
    {   template_name   => "members/members-update.tt",
34
        template_name   => "members/members-update.tt",
35
        query           => $query,
38
        query           => $query,
36
        type            => "intranet",
39
        type            => "intranet",
37
        authnotrequired => 0,
40
        authnotrequired => 0,
Lines 40-65 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
40
    }
43
    }
41
);
44
);
42
45
43
my $branch =
46
my $branch
44
  (      C4::Context->preference("IndependentBranchesPatronModifications")
47
    = (    C4::Context->preference("IndependentBranchesPatronModifications")
45
      || C4::Context->preference("IndependentBranches") )
48
        || C4::Context->preference("IndependentBranches") )
46
  && !$flags->{'superlibrarian'}
49
    && !$flags->{'superlibrarian'}
47
  ? C4::Context->userenv()->{'branch'}
50
    ? C4::Context->userenv()->{'branch'}
48
  : undef;
51
    : undef;
49
52
50
my $pending_modifications =
53
my $pending_modifications = Koha::Patron::Modifications->pending($branch);
51
  Koha::Patron::Modifications->pending($branch);
52
54
53
my $borrowers;
55
my $borrowers;
54
foreach my $pm (@$pending_modifications) {
56
foreach my $pm (@$pending_modifications) {
55
    $borrowers->{ $pm->{borrowernumber} }
57
56
        = GetMember( borrowernumber => $pm->{borrowernumber} );
58
    my @modified_atypes = uniq( map { $_->code } @{ $pm->{extended_attributes} } );
57
    my @patron_attributes
59
    my $modified_attributes;
58
        = grep { $_->opac_editable }
60
59
        Koha::Patron::Attributes->search(
61
    foreach my $type (@modified_atypes) {
60
        { borrowernumber => $pm->{borrowernumber} } );
62
        my $type_obj = Koha::Patron::Attribute::Types->find($type);
61
    $borrowers->{ $pm->{'borrowernumber'} }->{extended_attributes}
63
        my @before   = Koha::Patron::Attributes->search(
62
        = \@patron_attributes;
64
            { borrowernumber => $pm->{borrowernumber}, code => $type } );
65
        my @after = grep { $_->code eq $type } @{ $pm->{extended_attributes} };
66
        push @{$modified_attributes}, { type => $type_obj, before => \@before, after => \@after };
67
    }
68
69
    $borrowers->{ $pm->{borrowernumber} } = Koha::Patrons->find($pm->{borrowernumber})->unblessed;
70
    $borrowers->{ $pm->{borrowernumber} }->{modified_attributes} = $modified_attributes;
63
}
71
}
64
72
65
$template->param(
73
$template->param(
66
- 

Return to bug 13757