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

(-)a/Koha/Template/Plugin/Categories.pm (-1 / +2 lines)
Lines 23-29 use base qw( Template::Plugin ); Link Here
23
use Koha::Patron::Categories;
23
use Koha::Patron::Categories;
24
24
25
sub all {
25
sub all {
26
    return Koha::Patron::Categories->search_limited;
26
    my ( $self, $params ) = @_;
27
    return Koha::Patron::Categories->search_limited($params);
27
}
28
}
28
29
29
sub GetName {
30
sub GetName {
(-)a/circ/circulation.pl (-6 lines)
Lines 537-548 if ( $patron ) { Link Here
537
    }
537
    }
538
}
538
}
539
539
540
if ( $patron && $patron->is_child) {
541
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
542
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
543
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
544
}
545
546
my $messages = Koha::Patron::Messages->search(
540
my $messages = Koha::Patron::Messages->search(
547
    {
541
    {
548
        'me.borrowernumber' => $borrowernumber,
542
        'me.borrowernumber' => $borrowernumber,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-4 / +7 lines)
Lines 2-7 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Borrowers %]
3
[% USE Borrowers %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Categories %]
5
[% USE AuthorisedValues %]
6
[% USE AuthorisedValues %]
6
[% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
7
[% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
7
<div id="toolbar" class="btn-toolbar">
8
<div id="toolbar" class="btn-toolbar">
Lines 81-90 Link Here
81
                [% ELSE %]
82
                [% ELSE %]
82
                    <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
83
                    <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="You are not authorized to delete patrons" id="deletepatron" href="#">Delete</a></li>
83
                [% END %]
84
                [% END %]
84
                [% IF ( patron.is_child ) %]
85
                [% IF Categories.scalar.all(category_type => 'A').count > 0 %]
85
                    <li><a id="updatechild" href="#">Update child to adult patron</a></li>
86
                    [% IF patron.is_child %]
86
                [% ELSE %]
87
                        <li><a id="updatechild" href="#">Update child to adult patron</a></li>
87
                    <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li>
88
                    [% ELSE %]
89
                        <li class="disabled"><a data-toggle="tooltip" data-placement="left" title="Patron is an adult" id="updatechild" href="#">Update child to adult patron</a></li>
90
                    [% END %]
88
                [% END %]
91
                [% END %]
89
                [% IF Koha.Preference('intranetreadinghistory') %]
92
                [% IF Koha.Preference('intranetreadinghistory') %]
90
                    [%IF ( privacy == 2 ) %]
93
                    [%IF ( privacy == 2 ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-11 lines)
Lines 156-169 Link Here
156
</div><!-- /header_search -->
156
</div><!-- /header_search -->
157
</div><!-- /gradient -->
157
</div><!-- /gradient -->
158
<!-- End Patrons Resident Search Box -->
158
<!-- End Patrons Resident Search Box -->
159
160
<script type="text/javascript">
161
    var advsearch = "[% advsearch %]";
162
    var destination = "[% destination %]";
163
    var catcode = "[% catcode %]";
164
    var dateformat = "[% Koha.Preference('dateformat') %]";
165
    var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
166
    var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
167
    var CATCODE_MULTI = "[% CATCODE_MULTI %]";
168
    var borrowernumber = "[% patron.borrowernumber %]";
169
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc (+24 lines)
Line 0 Link Here
1
[% USE scalar %]
2
[% USE Koha %]
3
[% USE Categories %]
4
5
<script type="text/javascript">
6
    var advsearch = "[% advsearch %]";
7
    var destination = "[% destination %]";
8
9
    var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
10
11
    var dateformat = "[% Koha.Preference('dateformat') %]";
12
    var NorwegianPatronDBEnable = "[% Koha.Preference('NorwegianPatronDBEnable') %]";
13
14
    var borrowernumber;
15
    var number_of_adult_categories = 0;
16
    [% IF patron %]
17
        borrowernumber = "[% patron.borrowernumber %]";
18
        [% IF patron.is_child %]
19
            [% SET adult_categories = Categories.scalar.all(category_type => 'A') %]
20
            [% SET number_of_adult_categories = adult_categories.count %]
21
            number_of_adult_categories = [% number_of_adult_categories %]
22
        [% END %]
23
    [% END %]
24
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-9 / +1 lines)
Lines 1003-1017 No patron matched <span class="ex">[% message | html %]</span> Link Here
1003
        var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
1003
        var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
1004
        var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
1004
        var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
1005
1005
1006
        /* Set some variables needed in members-menu.js */
1007
        var advsearch = "[% advsearch %]";
1008
        var dateformat = "[% dateformat %]";
1009
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
1010
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
1011
        var catcode = "[% catcode %]";
1012
        var destination = "[% destination %]";
1013
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
1014
1015
        columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
1006
        columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
1016
1007
1017
        [% IF borrowernumber and patron %]
1008
        [% IF borrowernumber and patron %]
Lines 1104-1109 No patron matched <span class="ex">[% message | html %]</span> Link Here
1104
            [% END %]
1095
            [% END %]
1105
        });
1096
        });
1106
    </script>
1097
    </script>
1098
    [% INCLUDE 'str/members-menu.inc' %]
1107
    [% Asset.js("js/members-menu.js") %]
1099
    [% Asset.js("js/members-menu.js") %]
1108
[% END %]
1100
[% END %]
1109
1101
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt (-10 / +1 lines)
Lines 295-310 Link Here
295
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
295
    [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
296
    <script type="text/javascript">
296
    <script type="text/javascript">
297
297
298
        /* Set some variables needed in members-menu.js */
299
        var borrowernumber = "[% patron.borrowernumber %]";
300
        var advsearch = "[% advsearch %]";
301
        var dateformat = "[% dateformat %]";
302
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
303
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
304
        var catcode = "[% catcode %]";
305
        var destination = "[% destination %]";
306
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
307
308
        $(document).ready(function() {
298
        $(document).ready(function() {
309
            if($('#barcodelist').length) {
299
            if($('#barcodelist').length) {
310
                $('#barcodelist').focus();
300
                $('#barcodelist').focus();
Lines 322-327 Link Here
322
            }));
312
            }));
323
        });
313
        });
324
    </script>
314
    </script>
315
    [% INCLUDE 'str/members-menu.inc' %]
325
    [% Asset.js("js/members-menu.js") %]
316
    [% Asset.js("js/members-menu.js") %]
326
[% END %]
317
[% END %]
327
318
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/apikeys.tt (+1 lines)
Lines 100-105 Link Here
100
    </div>
100
    </div>
101
101
102
[% MACRO jsinclude BLOCK %]
102
[% MACRO jsinclude BLOCK %]
103
    [% INCLUDE 'str/members-menu.inc' %]
103
    [% Asset.js("js/members-menu.js") %]
104
    [% Asset.js("js/members-menu.js") %]
104
    <script>
105
    <script>
105
        $(document).ready(function(){
106
        $(document).ready(function(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +1 lines)
Lines 112-120 Link Here
112
[% MACRO jsinclude BLOCK %]
112
[% MACRO jsinclude BLOCK %]
113
    [% INCLUDE 'datatables.inc' %]
113
    [% INCLUDE 'datatables.inc' %]
114
    [% INCLUDE 'columns_settings.inc' %]
114
    [% INCLUDE 'columns_settings.inc' %]
115
    [% INCLUDE 'str/members-menu.inc' %]
115
    [% Asset.js("js/members-menu.js") %]
116
    [% Asset.js("js/members-menu.js") %]
116
    <script type="text/javascript">
117
    <script type="text/javascript">
117
        var dateformat = "[% Koha.Preference('dateformat') %]";
118
        $(document).ready(function() {
118
        $(document).ready(function() {
119
            var txtActivefilter = _("Filter paid transactions");
119
            var txtActivefilter = _("Filter paid transactions");
120
            var txtInactivefilter = _("Show all transactions");
120
            var txtInactivefilter = _("Show all transactions");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt (-11 / +1 lines)
Lines 63-80 Link Here
63
</div>
63
</div>
64
64
65
[% MACRO jsinclude BLOCK %]
65
[% MACRO jsinclude BLOCK %]
66
    [% INCLUDE 'str/members-menu.inc' %]
66
    [% Asset.js("js/members-menu.js") %]
67
    [% Asset.js("js/members-menu.js") %]
67
    <script>
68
        /* Set some variables needed in members-menu.js */
69
        var borrowernumber = "[% patron.borrowernumber %]";
70
        var advsearch = "[% advsearch %]";
71
        var dateformat = "[% dateformat %]";
72
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
73
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
74
        var catcode = "[% catcode %]";
75
        var destination = "[% destination %]";
76
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
77
    </script>
78
[% END %]
68
[% END %]
79
69
80
[% INCLUDE 'intranet-bottom.inc' %]
70
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt (+1 lines)
Lines 74-79 Link Here
74
</div>
74
</div>
75
75
76
[% MACRO jsinclude BLOCK %]
76
[% MACRO jsinclude BLOCK %]
77
    [% INCLUDE 'str/members-menu.inc' %]
77
    [% Asset.js("js/members-menu.js") %]
78
    [% Asset.js("js/members-menu.js") %]
78
[% END %]
79
[% END %]
79
80
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt (+1 lines)
Lines 51-56 Link Here
51
</div>
51
</div>
52
52
53
[% MACRO jsinclude BLOCK %]
53
[% MACRO jsinclude BLOCK %]
54
    [% INCLUDE 'str/members-menu.inc' %]
54
    [% Asset.js("js/members-menu.js") %]
55
    [% Asset.js("js/members-menu.js") %]
55
56
56
    [% INCLUDE 'datatables.inc' %]
57
    [% INCLUDE 'datatables.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt (+1 lines)
Lines 86-91 Link Here
86
    </div>
86
    </div>
87
87
88
[% MACRO jsinclude BLOCK %]
88
[% MACRO jsinclude BLOCK %]
89
    [% INCLUDE 'str/members-menu.inc' %]
89
    [% Asset.js("js/members-menu.js") %]
90
    [% Asset.js("js/members-menu.js") %]
90
    <script type="text/javascript">
91
    <script type="text/javascript">
91
        $(document).ready(function(){
92
        $(document).ready(function(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt (+1 lines)
Lines 106-111 Link Here
106
[% MACRO jsinclude BLOCK %]
106
[% MACRO jsinclude BLOCK %]
107
    [% INCLUDE 'datatables.inc' %]
107
    [% INCLUDE 'datatables.inc' %]
108
    [% INCLUDE 'columns_settings.inc' %]
108
    [% INCLUDE 'columns_settings.inc' %]
109
    [% INCLUDE 'str/members-menu.inc' %]
109
    [% Asset.js("js/members-menu.js") %]
110
    [% Asset.js("js/members-menu.js") %]
110
    <script type="text/javascript" id="js">
111
    <script type="text/javascript" id="js">
111
        $(document).ready(function() {
112
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt (-10 / +1 lines)
Lines 429-450 Link Here
429
    [% INCLUDE 'calendar.inc' %]
429
    [% INCLUDE 'calendar.inc' %]
430
    <script type="text/javascript">
430
    <script type="text/javascript">
431
431
432
        /* Set some variables needed in members-menu.js */
433
        var borrowernumber = "[% patron.borrowernumber %]";
434
        var advsearch = "[% advsearch %]";
435
        var dateformat = "[% dateformat %]";
436
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
437
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
438
        var catcode = "[% catcode %]";
439
        var destination = "[% destination %]";
440
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
441
442
        $(document).ready(function() {
432
        $(document).ready(function() {
443
            $("a.delete").click(function(){
433
            $("a.delete").click(function(){
444
                return confirm(_("Are you sure you want to delete this delivery?"));
434
                return confirm(_("Are you sure you want to delete this delivery?"));
445
            });
435
            });
446
        });
436
        });
447
    </script>
437
    </script>
438
    [% INCLUDE 'str/members-menu.inc' %]
448
    [% Asset.js("js/members-menu.js") %]
439
    [% Asset.js("js/members-menu.js") %]
449
[% END %]
440
[% END %]
450
441
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (+1 lines)
Lines 60-65 Link Here
60
</div>
60
</div>
61
61
62
[% MACRO jsinclude BLOCK %]
62
[% MACRO jsinclude BLOCK %]
63
    [% INCLUDE 'str/members-menu.inc' %]
63
    [% Asset.js("js/members-menu.js") %]
64
    [% Asset.js("js/members-menu.js") %]
64
    <script type="text/javascript">
65
    <script type="text/javascript">
65
        $(document).ready(function(){
66
        $(document).ready(function(){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (+1 lines)
Lines 73-78 Link Here
73
</div>
73
</div>
74
74
75
[% MACRO jsinclude BLOCK %]
75
[% MACRO jsinclude BLOCK %]
76
    [% INCLUDE 'str/members-menu.inc' %]
76
    [% Asset.js("js/members-menu.js") %]
77
    [% Asset.js("js/members-menu.js") %]
77
    <script type="text/javascript">
78
    <script type="text/javascript">
78
        var type_fees = {'L':'','F':'','A':'','N':'','M':''};
79
        var type_fees = {'L':'','F':'','A':'','N':'','M':''};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt (+1 lines)
Lines 86-91 Link Here
86
</div>
86
</div>
87
87
88
[% MACRO jsinclude BLOCK %]
88
[% MACRO jsinclude BLOCK %]
89
    [% INCLUDE 'str/members-menu.inc' %]
89
    [% Asset.js("js/members-menu.js") %]
90
    [% Asset.js("js/members-menu.js") %]
90
    [% Asset.js("lib/jquery/plugins/jquery.treeview.pack.js") %]
91
    [% Asset.js("lib/jquery/plugins/jquery.treeview.pack.js") %]
91
    <!-- set up tree -->
92
    <!-- set up tree -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt (+1 lines)
Lines 91-96 Link Here
91
</div>
91
</div>
92
92
93
[% MACRO jsinclude BLOCK %]
93
[% MACRO jsinclude BLOCK %]
94
    [% INCLUDE 'str/members-menu.inc' %]
94
    [% Asset.js("js/members-menu.js") %]
95
    [% Asset.js("js/members-menu.js") %]
95
    <script type="text/JavaScript">
96
    <script type="text/JavaScript">
96
97
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (+1 lines)
Lines 235-240 Link Here
235
[% MACRO jsinclude BLOCK %]
235
[% MACRO jsinclude BLOCK %]
236
    [% INCLUDE 'datatables.inc' %]
236
    [% INCLUDE 'datatables.inc' %]
237
    [% INCLUDE 'columns_settings.inc' %]
237
    [% INCLUDE 'columns_settings.inc' %]
238
    [% INCLUDE 'str/members-menu.inc' %]
238
    [% Asset.js("js/members-menu.js") %]
239
    [% Asset.js("js/members-menu.js") %]
239
    <script type="text/javascript">
240
    <script type="text/javascript">
240
        $(document).ready(function() {
241
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+1 lines)
Lines 1166-1171 Link Here
1166
[% MACRO jsinclude BLOCK %]
1166
[% MACRO jsinclude BLOCK %]
1167
    [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
1167
    [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
1168
    [% INCLUDE 'calendar.inc' %]
1168
    [% INCLUDE 'calendar.inc' %]
1169
    [% INCLUDE 'str/members-menu.inc' %]
1169
    [% Asset.js("js/members-menu.js") %]
1170
    [% Asset.js("js/members-menu.js") %]
1170
    <script type="text/javascript">
1171
    <script type="text/javascript">
1171
        $(document).ready(function() {
1172
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (+1 lines)
Lines 187-192 Link Here
187
    </div>
187
    </div>
188
188
189
[% MACRO jsinclude BLOCK %]
189
[% MACRO jsinclude BLOCK %]
190
    [% INCLUDE 'str/members-menu.inc' %]
190
    [% Asset.js("js/members-menu.js") %]
191
    [% Asset.js("js/members-menu.js") %]
191
    <script type="text/javascript">
192
    <script type="text/javascript">
192
        $(function() {
193
        $(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/merge-patrons.tt (+1 lines)
Lines 135-140 Link Here
135
    </div>
135
    </div>
136
136
137
[% MACRO jsinclude BLOCK %]
137
[% MACRO jsinclude BLOCK %]
138
    [% INCLUDE 'str/members-menu.inc' %]
138
    [% Asset.js("js/members-menu.js") %]
139
    [% Asset.js("js/members-menu.js") %]
139
140
140
    <script>
141
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 768-773 Link Here
768
    [% Asset.js("js/pages/circulation.js") %]
768
    [% Asset.js("js/pages/circulation.js") %]
769
    [% Asset.js("js/checkouts.js") %]
769
    [% Asset.js("js/checkouts.js") %]
770
    [% Asset.js("js/holds.js") %]
770
    [% Asset.js("js/holds.js") %]
771
    [% INCLUDE 'str/members-menu.inc' %]
771
    [% Asset.js("js/members-menu.js") %]
772
    [% Asset.js("js/members-menu.js") %]
772
    [% Asset.js("js/messaging-preference-form.js") %]
773
    [% Asset.js("js/messaging-preference-form.js") %]
773
    <script>
774
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt (+1 lines)
Lines 79-84 Link Here
79
    </div>
79
    </div>
80
80
81
[% MACRO jsinclude BLOCK %]
81
[% MACRO jsinclude BLOCK %]
82
    [% INCLUDE 'str/members-menu.inc' %]
82
    [% Asset.js("js/members-menu.js") %]
83
    [% Asset.js("js/members-menu.js") %]
83
[% END %]
84
[% END %]
84
85
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-10 / +1 lines)
Lines 93-108 Link Here
93
    [% INCLUDE 'datatables.inc' %]
93
    [% INCLUDE 'datatables.inc' %]
94
    <script type="text/javascript">
94
    <script type="text/javascript">
95
95
96
        /* Set some variables needed in members-menu.js */
97
        var borrowernumber = "[% patron.borrowernumber %]";
98
        var advsearch = "[% advsearch %]";
99
        var dateformat = "[% dateformat %]";
100
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
101
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
102
        var catcode = "[% catcode %]";
103
        var destination = "[% destination %]";
104
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
105
106
        $(document).ready(function() {
96
        $(document).ready(function() {
107
            $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
97
            $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
108
                "aaSorting": [[ 3, "desc" ]],
98
                "aaSorting": [[ 3, "desc" ]],
Lines 126-131 Link Here
126
            });
116
            });
127
        });
117
        });
128
    </script>
118
    </script>
119
    [% INCLUDE 'str/members-menu.inc' %]
129
    [% Asset.js("js/members-menu.js") %]
120
    [% Asset.js("js/members-menu.js") %]
130
[% END %]
121
[% END %]
131
122
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (+1 lines)
Lines 138-143 Link Here
138
</div>
138
</div>
139
139
140
[% MACRO jsinclude BLOCK %]
140
[% MACRO jsinclude BLOCK %]
141
    [% INCLUDE 'str/members-menu.inc' %]
141
    [% Asset.js("js/members-menu.js") %]
142
    [% Asset.js("js/members-menu.js") %]
142
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
143
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
143
    <script type= "text/javascript">
144
    <script type= "text/javascript">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (+1 lines)
Lines 233-238 Link Here
233
</div>
233
</div>
234
234
235
[% MACRO jsinclude BLOCK %]
235
[% MACRO jsinclude BLOCK %]
236
    [% INCLUDE 'str/members-menu.inc' %]
236
    [% Asset.js("js/members-menu.js") %]
237
    [% Asset.js("js/members-menu.js") %]
237
    <script type= "text/javascript">
238
    <script type= "text/javascript">
238
        $(document).ready(function() {
239
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt (+1 lines)
Lines 101-106 Link Here
101
</div>
101
</div>
102
102
103
[% MACRO jsinclude BLOCK %]
103
[% MACRO jsinclude BLOCK %]
104
    [% INCLUDE 'str/members-menu.inc' %]
104
    [% Asset.js("js/members-menu.js") %]
105
    [% Asset.js("js/members-menu.js") %]
105
    [% INCLUDE 'datatables.inc' %]
106
    [% INCLUDE 'datatables.inc' %]
106
    <script type="text/javascript">
107
    <script type="text/javascript">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (+1 lines)
Lines 119-124 Link Here
119
</div>
119
</div>
120
120
121
[% MACRO jsinclude BLOCK %]
121
[% MACRO jsinclude BLOCK %]
122
    [% INCLUDE 'str/members-menu.inc' %]
122
    [% Asset.js("js/members-menu.js") %]
123
    [% Asset.js("js/members-menu.js") %]
123
    [% INCLUDE 'datatables.inc' %]
124
    [% INCLUDE 'datatables.inc' %]
124
    <script type="text/javascript" id="js">
125
    <script type="text/javascript" id="js">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt (+1 lines)
Lines 88-93 Link Here
88
</div>
88
</div>
89
89
90
[% MACRO jsinclude BLOCK %]
90
[% MACRO jsinclude BLOCK %]
91
    [% INCLUDE 'str/members-menu.inc' %]
91
    [% Asset.js("js/members-menu.js") %]
92
    [% Asset.js("js/members-menu.js") %]
92
[% END %]
93
[% END %]
93
94
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt (+1 lines)
Lines 90-95 Link Here
90
</div>
90
</div>
91
91
92
[% MACRO jsinclude BLOCK %]
92
[% MACRO jsinclude BLOCK %]
93
    [% INCLUDE 'str/members-menu.inc' %]
93
    [% Asset.js("js/members-menu.js") %]
94
    [% Asset.js("js/members-menu.js") %]
94
    [% INCLUDE 'datatables.inc' %]
95
    [% INCLUDE 'datatables.inc' %]
95
    <script type="text/javascript">
96
    <script type="text/javascript">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt (-24 / +1 lines)
Lines 38-46 Link Here
38
                </table>
38
                </table>
39
                <input type="hidden" name="op" value="update" />
39
                <input type="hidden" name="op" value="update" />
40
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
40
                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
41
                <input type="hidden" name="catcode" value="[% catcode %]" />
42
                <input type="hidden" name="cattype" value="[% cattype %]" />
41
                <input type="hidden" name="cattype" value="[% cattype %]" />
43
                <input type="hidden" name="catcode_multi" value="[% CATCODE_MULTI %]" />
44
                <fieldset class="action">
42
                <fieldset class="action">
45
                    <input class="submit" type="submit" value="Submit" />
43
                    <input class="submit" type="submit" value="Submit" />
46
                    <a href="#" class="cancel close">Cancel</a>
44
                    <a href="#" class="cancel close">Cancel</a>
Lines 55-70 Link Here
55
    [% INCLUDE 'datatables.inc' %]
53
    [% INCLUDE 'datatables.inc' %]
56
    <script type="text/javascript">
54
    <script type="text/javascript">
57
55
58
        /* Set some variables needed in members-menu.js */
59
        var advsearch = "[% advsearch %]";
60
        var dateformat = "[% dateformat %]";
61
        var CAN_user_borrowers = "[% CAN_user_borrowers %]";
62
        var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
63
        var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
64
        var CATCODE_MULTI = "[% CATCODE_MULTI %]";
65
        var catcode = "[% catcode %]";
66
        var destination = "[% destination %]";
67
68
        $(document).ready(function() {
56
        $(document).ready(function() {
69
            $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
57
            $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
70
                "sDom": 't',
58
                "sDom": 't',
Lines 76-99 Link Here
76
            }));
64
            }));
77
        });
65
        });
78
    </script>
66
    </script>
79
    [% IF ( CONFIRM ) %]
80
        <script type="text/javascript">
81
            function confirm_updatechild() {
82
                var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult category?  This cannot be undone.');
83
                if (is_confirmed) {
84
                        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
85
                }
86
            }
87
88
            confirm_updatechild([% borrowernumber %]);
89
        </script>
90
    [% END %]
91
    [% IF ( SUCCESS ) %]
67
    [% IF ( SUCCESS ) %]
92
        <script type="text/javascript">
68
        <script type="text/javascript">
93
            self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
69
            self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
94
            window.close();
70
            window.close();
95
        </script>
71
        </script>
96
    [% END %]
72
    [% END %]
73
    [% INCLUDE 'str/members-menu.inc' %]
97
    [% Asset.js("js/members-menu.js") %]
74
    [% Asset.js("js/members-menu.js") %]
98
[% END %]
75
[% END %]
99
76
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt (+1 lines)
Lines 291-296 you can supply dates in ISO format (e.g., '2010-10-28'). Link Here
291
[% MACRO jsinclude BLOCK %]
291
[% MACRO jsinclude BLOCK %]
292
    [% INCLUDE 'calendar.inc' %]
292
    [% INCLUDE 'calendar.inc' %]
293
    [% Asset.js("js/tools-menu.js") %]
293
    [% Asset.js("js/tools-menu.js") %]
294
    [% INCLUDE 'str/members-menu.inc' %]
294
    [% Asset.js("js/members-menu.js") %]
295
    [% Asset.js("js/members-menu.js") %]
295
    <script type="text/javascript">
296
    <script type="text/javascript">
296
        $(document).ready(function() {
297
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt (+1 lines)
Lines 142-147 Link Here
142
142
143
[% MACRO jsinclude BLOCK %]
143
[% MACRO jsinclude BLOCK %]
144
    [% Asset.js("js/tools-menu.js") %]
144
    [% Asset.js("js/tools-menu.js") %]
145
    [% INCLUDE 'str/members-menu.inc' %]
145
    [% Asset.js("js/members-menu.js") %]
146
    [% Asset.js("js/members-menu.js") %]
146
    <script type="text/javascript">
147
    <script type="text/javascript">
147
        $(document).ready(function() {
148
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (-3 / +3 lines)
Lines 1-4 Link Here
1
/* global borrowernumber advsearch dateformat _ CAN_user_borrowers_edit_borrowers NorwegianPatronDBEnable CATCODE_MULTI catcode destination */
1
/* global borrowernumber advsearch dateformat _ CAN_user_borrowers_edit_borrowers NorwegianPatronDBEnable number_of_adult_categories destination */
2
2
3
$(document).ready(function(){
3
$(document).ready(function(){
4
    $("#filteraction_off, #filteraction_on").on('click', function(e) {
4
    $("#filteraction_off, #filteraction_on").on('click', function(e) {
Lines 123-134 function confirm_both_deletion() { Link Here
123
function confirm_updatechild() {
123
function confirm_updatechild() {
124
    var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category?  This cannot be undone."));
124
    var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category?  This cannot be undone."));
125
    if (is_confirmed) {
125
    if (is_confirmed) {
126
        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=' + borrowernumber + '&catcode=' + catcode + '&catcode_multi=' + CATCODE_MULTI;
126
        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=' + borrowernumber;
127
    }
127
    }
128
}
128
}
129
129
130
function update_child() {
130
function update_child() {
131
    if( CATCODE_MULTI ){
131
    if( number_of_adult_categories > 1 ){
132
        window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=' + borrowernumber,'UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
132
        window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=' + borrowernumber,'UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
133
    } else {
133
    } else {
134
        confirm_updatechild();
134
        confirm_updatechild();
(-)a/members/boraccount.pl (-6 lines)
Lines 69-80 elsif ( $action eq 'void' ) { Link Here
69
    $payment->void();
69
    $payment->void();
70
}
70
}
71
71
72
if ( $patron->is_child ) {
73
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
74
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
75
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
76
}
77
78
#get account details
72
#get account details
79
my $total = $patron->account->balance;
73
my $total = $patron->account->balance;
80
74
(-)a/members/deletemem.pl (-6 lines)
Lines 101-112 if (C4::Context->preference("IndependentBranches")) { Link Here
101
    }
101
    }
102
}
102
}
103
103
104
if ( $patron->is_child ) {
105
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
106
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
107
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
108
}
109
110
my $op = $input->param('op') || 'delete_confirm';
104
my $op = $input->param('op') || 'delete_confirm';
111
my $dbh = C4::Context->dbh;
105
my $dbh = C4::Context->dbh;
112
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
106
my $is_guarantor = $dbh->selectrow_array("SELECT COUNT(*) FROM borrowers WHERE guarantorid=?", undef, $member);
(-)a/members/files.pl (-6 lines)
Lines 115-126 else { Link Here
115
        );
115
        );
116
    }
116
    }
117
117
118
    if ( $patron->is_child ) {
119
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
120
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
121
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
122
    }
123
124
    $template->param(
118
    $template->param(
125
        files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
119
        files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )
126
          ->GetFilesInfo(),
120
          ->GetFilesInfo(),
(-)a/members/holdshistory.pl (-6 lines)
Lines 74-85 if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){ Link Here
74
    }
74
    }
75
}
75
}
76
76
77
if ( $patron->is_child) {
78
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
79
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
80
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
81
}
82
83
$template->param(
77
$template->param(
84
    holdshistoryview => 1,
78
    holdshistoryview => 1,
85
    patron           => $patron,
79
    patron           => $patron,
(-)a/members/housebound.pl (-6 lines)
Lines 166-177 if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) { Link Here
166
    );
166
    );
167
}
167
}
168
168
169
if ( $patron->is_child ) {
170
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
171
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
172
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
173
}
174
175
$template->param(
169
$template->param(
176
    housebound_profile => $houseboundprofile,
170
    housebound_profile => $houseboundprofile,
177
    visit              => $houseboundvisit,
171
    visit              => $houseboundvisit,
(-)a/members/mancredit.pl (-5 lines)
Lines 99-109 if ($add){ Link Here
99
    );
99
    );
100
    my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
100
    my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
101
    output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
101
    output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
102
    if ( $patron->is_child ) {
103
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
104
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
105
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
106
    }
107
102
108
    if (C4::Context->preference('ExtendedPatronAttributes')) {
103
    if (C4::Context->preference('ExtendedPatronAttributes')) {
109
        my $attributes = GetBorrowerAttributes($borrowernumber);
104
        my $attributes = GetBorrowerAttributes($borrowernumber);
(-)a/members/maninvoice.pl (-6 lines)
Lines 114-125 if ($add){ Link Here
114
  }
114
  }
115
  $template->param( invoice_types_loop => \@invoice_types );
115
  $template->param( invoice_types_loop => \@invoice_types );
116
116
117
    if ( $patron->is_child ) {
118
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
119
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
120
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
121
    }
122
123
    if (C4::Context->preference('ExtendedPatronAttributes')) {
117
    if (C4::Context->preference('ExtendedPatronAttributes')) {
124
        my $attributes = GetBorrowerAttributes($borrowernumber);
118
        my $attributes = GetBorrowerAttributes($borrowernumber);
125
        $template->param(
119
        $template->param(
(-)a/members/member-flags.pl (-6 lines)
Lines 182-193 if ($input->param('newflags')) { Link Here
182
        push @loop, \%row;
182
        push @loop, \%row;
183
    }
183
    }
184
184
185
    if ( $patron->is_child ) {
186
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
187
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
188
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
189
    }
190
191
if (C4::Context->preference('ExtendedPatronAttributes')) {
185
if (C4::Context->preference('ExtendedPatronAttributes')) {
192
    my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
186
    my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'});
193
    $template->param(
187
    $template->param(
(-)a/members/member-password.pl (-6 lines)
Lines 95-106 if ( $newpassword and not @errors) { Link Here
95
    }
95
    }
96
}
96
}
97
97
98
if ( $patron->is_child ) {
99
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
100
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
101
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
102
}
103
104
if ( C4::Context->preference('ExtendedPatronAttributes') ) {
98
if ( C4::Context->preference('ExtendedPatronAttributes') ) {
105
    my $attributes = GetBorrowerAttributes( $bor->{'borrowernumber'} );
99
    my $attributes = GetBorrowerAttributes( $bor->{'borrowernumber'} );
106
    $template->param(
100
    $template->param(
(-)a/members/moremember.pl (-6 lines)
Lines 165-176 if ( $patron->is_debarred ) { Link Here
165
165
166
$data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex};
166
$data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex};
167
167
168
if ( $patron->is_child ) {
169
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
170
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
171
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
172
}
173
174
my @relatives;
168
my @relatives;
175
if ( my $guarantor = $patron->guarantor ) {
169
if ( my $guarantor = $patron->guarantor ) {
176
    $template->param( guarantor => $guarantor );
170
    $template->param( guarantor => $guarantor );
(-)a/members/notices.pl (-6 lines)
Lines 51-62 my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => Link Here
51
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
51
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
52
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
52
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
53
53
54
if ( $patron->is_child ) {
55
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
56
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
57
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
58
}
59
60
# Allow resending of messages in Notices tab
54
# Allow resending of messages in Notices tab
61
my $op = $input->param('op') || q{};
55
my $op = $input->param('op') || q{};
62
if ( $op eq 'resend_notice' ) {
56
if ( $op eq 'resend_notice' ) {
(-)a/members/pay.pl (-6 lines)
Lines 234-245 sub borrower_add_additional_fields { Link Here
234
# some borrower info is not returned in the standard call despite being assumed
234
# some borrower info is not returned in the standard call despite being assumed
235
# in a number of templates. It should not be the business of this script but in lieu of
235
# in a number of templates. It should not be the business of this script but in lieu of
236
# a revised api here it is ...
236
# a revised api here it is ...
237
    if ( $patron->is_child ) {
238
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
239
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
240
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
241
    }
242
243
    if (C4::Context->preference('ExtendedPatronAttributes')) {
237
    if (C4::Context->preference('ExtendedPatronAttributes')) {
244
        my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber);
238
        my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber);
245
        $template->param(
239
        $template->param(
(-)a/members/paycollect.pl (-5 lines)
Lines 206-216 sub borrower_add_additional_fields { Link Here
206
# some borrower info is not returned in the standard call despite being assumed
206
# some borrower info is not returned in the standard call despite being assumed
207
# in a number of templates. It should not be the business of this script but in lieu of
207
# in a number of templates. It should not be the business of this script but in lieu of
208
# a revised api here it is ...
208
# a revised api here it is ...
209
    if ( $patron->is_child ) {
210
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
211
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
212
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
213
    }
214
209
215
    if (C4::Context->preference('ExtendedPatronAttributes')) {
210
    if (C4::Context->preference('ExtendedPatronAttributes')) {
216
        my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber);
211
        my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber);
(-)a/members/printinvoice.pl (-6 lines)
Lines 53-64 my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" Link Here
53
my $patron         = Koha::Patrons->find( $borrowernumber );
53
my $patron         = Koha::Patrons->find( $borrowernumber );
54
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
54
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
55
55
56
if ( $patron->is_child ) {
57
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
58
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
59
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
60
}
61
62
#get account details
56
#get account details
63
my $total = $patron->account->balance;
57
my $total = $patron->account->balance;
64
my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed;
58
my $accountline = Koha::Account::Lines->find($accountlines_id)->unblessed;
(-)a/members/readingrec.pl (-6 lines)
Lines 92-103 if ( $op eq 'export_barcodes' ) { Link Here
92
    }
92
    }
93
}
93
}
94
94
95
if ( $patron->is_child ) {
96
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
97
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
98
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
99
}
100
101
if (! $limit){
95
if (! $limit){
102
	$limit = 'full';
96
	$limit = 'full';
103
}
97
}
(-)a/members/statistics.pl (-6 lines)
Lines 85-96 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
85
    );
85
    );
86
}
86
}
87
87
88
if ( $patron->is_child ) {
89
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
90
    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
91
    $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
92
}
93
94
$template->param(
88
$template->param(
95
    patron             => $patron,
89
    patron             => $patron,
96
    statisticsview     => 1,
90
    statisticsview     => 1,
(-)a/members/update-child.pl (-6 / +16 lines)
Lines 53-70 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
53
my $borrowernumber = $input->param('borrowernumber');
53
my $borrowernumber = $input->param('borrowernumber');
54
my $catcode        = $input->param('catcode');
54
my $catcode        = $input->param('catcode');
55
my $cattype        = $input->param('cattype');
55
my $cattype        = $input->param('cattype');
56
my $catcode_multi = $input->param('catcode_multi');
57
my $op             = $input->param('op');
56
my $op             = $input->param('op');
58
57
59
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
58
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
60
59
60
my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
61
if ( $op eq 'multi' ) {
61
if ( $op eq 'multi' ) {
62
    # FIXME - what are the possible upgrade paths?  C -> A , C -> S ...
62
    # FIXME - what are the possible upgrade paths?  C -> A , C -> S ...
63
    #   currently just allowing C -> A
63
    #   currently just allowing C -> A
64
    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
65
    $template->param(
64
    $template->param(
66
        MULTI             => 1,
65
        MULTI             => 1,
67
        CATCODE_MULTI     => 1,
68
        borrowernumber    => $borrowernumber,
66
        borrowernumber    => $borrowernumber,
69
        patron_categories => $patron_categories,
67
        patron_categories => $patron_categories,
70
    );
68
    );
Lines 75-85 elsif ( $op eq 'update' ) { Link Here
75
    my $patron         = Koha::Patrons->find( $borrowernumber );
73
    my $patron         = Koha::Patrons->find( $borrowernumber );
76
    output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
74
    output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
77
75
76
    my $adult_category;
77
    if ( $patron_categories->count == 1 ) {
78
        $adult_category = $patron_categories->next;
79
    } else {
80
        $adult_category = $patron_categories->search({'me.categorycode' => $catcode })->next;
81
    }
82
83
    # Just in case someone is trying something bad
84
    # But we should not hit that with a normal use of the interface
85
    die "You are doing something wrong updating this child" unless $adult_category;
86
78
    $patron->guarantorid(undef);
87
    $patron->guarantorid(undef);
79
    $patron->categorycode($catcode);
88
    $patron->categorycode($adult_category->categorycode);
80
    $patron->store;
89
    $patron->store;
81
90
82
    if (  $catcode_multi ) {
91
    # FIXME We should not need that
92
    # We could redirect with a friendly message
93
    if ( $patron_categories->count > 1 ) {
83
        $template->param(
94
        $template->param(
84
                SUCCESS        => 1,
95
                SUCCESS        => 1,
85
                borrowernumber => $borrowernumber,
96
                borrowernumber => $borrowernumber,
86
- 

Return to bug 20226