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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (-93 / +95 lines)
Lines 109-203 Link Here
109
        <div class="col-md-8 col-md-offset-2">
109
        <div class="col-md-8 col-md-offset-2">
110
110
111
            [% IF PendingModifications %]
111
            [% IF PendingModifications %]
112
            <h2>Update patron records</h2>
112
                <h2>Update patron records</h2>
113
                <form method="post" action="members-update-do.pl">
113
                <form method="post" action="members-update-do.pl">
114
                    <div id="pending_updates">
114
                    <div id="pending_updates" class="panel-group" role="tablist" aria-multiselectable="true">
115
                            [% FOREACH pm IN PendingModifications %]
115
                        [% FOREACH pm IN PendingModifications %]
116
                                [% SET borrowernumber = pm.borrowernumber %]
116
                            [% SET borrowernumber = pm.borrowernumber %]
117
                                <h3 class="panel-header" id="panel-header-[% pm.borrowernumber | html %]"><a href="#panel_modify_[% pm.borrowernumber | uri %]">[% borrowers.$borrowernumber.surname | html %][% IF ( borrowers.$borrowernumber.firstname ) %], [% borrowers.$borrowernumber.firstname | html %][% END %] - [% Categories.GetName( borrowers.$borrowernumber.categorycode ) | html %] ([% Branches.GetName( borrowers.$borrowernumber.branchcode ) | html %]) ([% borrowers.$borrowernumber.cardnumber | html %]) - Requested on [% pm.timestamp | $KohaDates with_hours = 1 %]</a></h3>
117
                            <div class="panel panel-default">
118
                                <div id="panel_modify_[% pm.borrowernumber | html %]">
118
                                <div class="panel-heading" role="tab" id="panel-header-[% pm.borrowernumber | html %]">
119
                                    <div class="btn-toolbar">
119
                                    <h3 class="panel-title">
120
                                        <input type="radio" id="approve_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="approve" />
120
                                        <a role="button" class="collapsed" data-toggle="collapse" data-parent="#pending_updates" aria-controls="panel_modify_[% pm.borrowernumber | html %]" href="#panel_modify_[% pm.borrowernumber | uri %]">[% borrowers.$borrowernumber.surname | html %][% IF ( borrowers.$borrowernumber.firstname ) %], [% borrowers.$borrowernumber.firstname | html %][% END %] - [% Categories.GetName( borrowers.$borrowernumber.categorycode ) | html %] ([% Branches.GetName( borrowers.$borrowernumber.branchcode ) | html %]) ([% borrowers.$borrowernumber.cardnumber | html %]) - Requested on [% pm.timestamp | $KohaDates with_hours = 1 %]</a>
121
                                        <label for="approve_modify_[% pm.borrowernumber | html %]">Approve</label>
121
                                    </h3>
122
122
                                </div> <!-- /.panel-heading -->
123
                                        <input type="radio" id="deny_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="deny" />
123
                                <div id="panel_modify_[% pm.borrowernumber | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="panel-header-[% pm.borrowernumber | html %]">
124
                                        <label for="deny_modify_[% pm.borrowernumber | html %]">Deny</label>
124
                                    <div class="panel-body">
125
125
                                        <div class="btn-toolbar">
126
                                        <input type="radio" id="ignore_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="ignore" checked="checked"/>
126
                                            <input type="radio" id="approve_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="approve" />
127
                                        <label for="ignore_modify_[% pm.borrowernumber | html %]">Ignore</label>
127
                                            <label for="approve_modify_[% pm.borrowernumber | html %]">Approve</label>
128
                                        | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber | html %]" >Patron details</a>
128
129
                                    </div>
129
                                            <input type="radio" id="deny_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="deny" />
130
130
                                            <label for="deny_modify_[% pm.borrowernumber | html %]">Deny</label>
131
                                    [% IF borrowers.$borrowernumber.gonenoaddress > 0 %]
131
132
                                        <div class="dialog message" style="margin-top:.8em">
132
                                            <input type="radio" id="ignore_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="ignore" checked="checked"/>
133
                                            <h4>Patron's address in doubt</h4>
133
                                            <label for="ignore_modify_[% pm.borrowernumber | html %]">Ignore</label>
134
                                            <p>The <strong>Gone no address</strong> flag is set for this patron. If this modification request resolves the issue, please unset the flag.</p>
134
                                            | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber | html %]" >Patron details</a>
135
                                            <input type="checkbox" id="unset_gna_[% pm.borrowernumber | html %]" name="unset_gna_[% pm.borrowernumber | html %]" value="unset_gna_[% pm.borrowernumber | html %]"/>
136
                                            <label for="unset_gna_[% pm.borrowernumber | html %]">Unset Gone no address for this patron</label>
137
                                        </div>
135
                                        </div>
138
                                    [% END %]
136
139
137
                                        [% IF borrowers.$borrowernumber.gonenoaddress > 0 %]
140
                                  [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %]
138
                                            <div class="dialog message" style="margin-top:.8em">
141
                                  [%# timestamp+verification_token+borrowernumber=3 %]
139
                                                <h4>Patron's address in doubt</h4>
142
                                    <div class="members-update-table">
140
                                                <p>The <strong>Gone no address</strong> flag is set for this patron. If this modification request resolves the issue, please unset the flag.</p>
143
                                        <table>
141
                                                <input type="checkbox" id="unset_gna_[% pm.borrowernumber | html %]" name="unset_gna_[% pm.borrowernumber | html %]" value="unset_gna_[% pm.borrowernumber | html %]"/>
144
                                            <tr>
142
                                                <label for="unset_gna_[% pm.borrowernumber | html %]">Unset Gone no address for this patron</label>
145
                                                <th>Field</th>
143
                                            </div>
146
                                                <th>Old value</th>
144
                                        [% END %]
147
                                                <th>New value</th>
145
148
                                            </tr>
146
                                        [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %]
149
147
                                            [%# timestamp+verification_token+borrowernumber=3 %]
150
148
                                            <div class="members-update-table">
151
                                            [% FOREACH key IN pm.keys %]
149
                                                <table>
152
                                                [% IF ( key != "timestamp" and key != "extended_attributes" ) %]
150
                                                    <tr>
153
                                                    [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
151
                                                        <th>Field</th>
154
                                                        <tr>
152
                                                        <th>Old value</th>
155
                                                            <td>[% PROCESS display_names field = key %]</td>
153
                                                        <th>New value</th>
156
                                                            [% IF ( key == "dateofbirth" ) %]
154
                                                    </tr>
157
                                                                <td>[% borrowers.$borrowernumber.$key | $KohaDates %]</td>
155
158
                                                                <td>[% pm.$key | $KohaDates %]</td>
156
159
                                                            [% ELSIF key == 'branchcode' %]
157
                                                    [% FOREACH key IN pm.keys %]
160
                                                                <td>[% Branches.GetName( borrowers.$borrowernumber.$key ) | html %]</td>
158
                                                        [% IF ( key != "timestamp" and key != "extended_attributes" ) %]
161
                                                                <td>[% Branches.GetName( pm.$key ) | html %]</td>
159
                                                            [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
162
                                                            [% ELSE %]
160
                                                                <tr>
163
                                                                <td>[% borrowers.$borrowernumber.$key | html %]</td>
161
                                                                    <td>[% PROCESS display_names field = key %]</td>
164
                                                                <td>[% pm.$key | html %]</td>
162
                                                                    [% IF ( key == "dateofbirth" ) %]
163
                                                                        <td>[% borrowers.$borrowernumber.$key | $KohaDates %]</td>
164
                                                                        <td>[% pm.$key | $KohaDates %]</td>
165
                                                                    [% ELSIF key == 'branchcode' %]
166
                                                                        <td>[% Branches.GetName( borrowers.$borrowernumber.$key ) | html %]</td>
167
                                                                        <td>[% Branches.GetName( pm.$key ) | html %]</td>
168
                                                                    [% ELSE %]
169
                                                                        <td>[% borrowers.$borrowernumber.$key | html %]</td>
170
                                                                        <td>[% pm.$key | html %]</td>
171
                                                                    [% END %]
172
                                                                </tr>
165
                                                            [% END %]
173
                                                            [% END %]
174
                                                        [% END %]
175
                                                    [% END %]
176
                                                </table>
177
                                            </div> <!-- /.members-update-table -->
178
                                        [% END # /!pm.extended_attributes %]
179
                                        [% IF borrowers.$borrowernumber.modified_attributes %]
180
                                            <div class="members-update-table">
181
                                                <h4>[% PROCESS display_names field='extended_attributes' %]</h4>
182
                                                <table>
183
                                                    <tr>
184
                                                        <th>Field</th>
185
                                                        <th>Old value</th>
186
                                                        <th>New value</th>
187
                                                    </tr>
188
                                                    [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %]
189
                                                        <tr>
190
                                                            <td>[% attribute_group.type.description | html %]</td>
191
                                                            <td>[% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %]</td>
192
                                                            <td>[% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]</td>
166
                                                        </tr>
193
                                                        </tr>
167
                                                    [% END %]
194
                                                    [% END %]
168
                                                [% END %]
195
                                                </table>
169
                                            [% END %]
196
                                            </div> <!-- /.members-update-table -->
170
                                        </table>
197
                                        [% END # / borrowers.$borrowernumber.modified_attributes %]
171
                                    </div>
198
                                    </div> <!-- /.panel-body -->
172
                                  [%  END %]
199
                                </div> <!-- /.panel-collapse.collapse -->
173
                                  [% IF borrowers.$borrowernumber.modified_attributes %]
200
                            </div> <!-- /panel.panel-default -->
174
                                    <div class="members-update-table">
201
                        [% END # /FOREACH pm %]
175
                                        <h4>[% PROCESS display_names field='extended_attributes' %]</h4>
202
                    </div> <!-- /#pending-updates -->
176
                                        <table>
177
                                            <tr>
178
                                                <th>Field</th>
179
                                                <th>Old value</th>
180
                                                <th>New value</th>
181
                                            </tr>
182
                                          [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %]
183
                                            <tr>
184
                                                <td>[% attribute_group.type.description | html %]</td>
185
                                                <td>[% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %]</td>
186
                                                <td>[% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]</td>
187
                                            </tr>
188
                                          [% END %]
189
                                        </table>
190
                                    </div>
191
                                  [%  END %]
192
                                </div>
193
                            [% END %]
194
                        </div>
195
                    <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
203
                    <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
196
                </form>
204
                </form>
197
            [% ELSE %]
205
            [% ELSE %]
198
            <div class="dialog message">
206
                <div class="dialog message">
199
                <p>There are no pending patron modifications.</p>
207
                    <p>There are no pending patron modifications.</p>
200
            </div>
208
                </div>
201
            [% END %]
209
            [% END %]
202
210
203
        </div>
211
        </div>
Lines 207-223 Link Here
207
    [% INCLUDE 'str/members-menu.inc' %]
215
    [% INCLUDE 'str/members-menu.inc' %]
208
    [% Asset.js("js/members-menu.js") | $raw %]
216
    [% Asset.js("js/members-menu.js") | $raw %]
209
    <script>
217
    <script>
210
        $(function() {
218
        $(document).ready(function(){
211
            $( "#pending_updates" ).accordion({
219
            [%- IF ( active ) -%]
212
                collapsible: true,
220
                $("#pending_updates a[href='#panel_modify_" + [% active | html %] + "']").click();
213
                heightStyle: "content",
221
            [%- ELSE -%]
214
                header: ".panel-header",
222
                $("#pending_updates a.collapsed:eq(0)").click();
215
                [%- IF ( active ) -%]
223
            [%- END -%]
216
                    active: $(".panel-header").index( $("#panel-header-[% active | html %]") )
217
                [%- ELSE -%]
218
                    active: 0
219
                [%- END -%]
220
            });
221
        });
224
        });
222
    </script>
225
    </script>
223
[% END %]
226
[% END %]
224
- 

Return to bug 30549