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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (-28 lines)
Lines 1-31 Link Here
1
<script type="text/javascript">
2
   //<![CDATA[
3
        $(document).ready(function(e){
4
            $("div#reldebarments .remove_restriction").on("click",function(){
5
                return confirm(_("Remove restriction?"));
6
            });
7
            var mrform = $("#manual_restriction_form");
8
            var mrlink = $("#add_manual_restriction");
9
            mrform.hide();
10
            mrlink.on("click",function(e){
11
                $(this).hide();
12
                mrform.show();
13
                e.preventDefault();
14
            });
15
            $("#cancel_manual_restriction").on("click",function(e){
16
                mrlink.show();
17
                mrform.hide();
18
                e.preventDefault();
19
            });
20
            $(".clear-date").on("click",function(e){
21
                e.preventDefault();
22
                var fieldID = this.id.replace("clear-date-","");
23
                $("#" + fieldID).val("");
24
            });
25
        })
26
    //]]>
27
</script>
28
29
<div id="reldebarments">
1
<div id="reldebarments">
30
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
2
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
31
        <p>Patron is currently unrestricted.</p>
3
        <p>Patron is currently unrestricted.</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-128 lines)
Lines 3-136 Link Here
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
5
[% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]
6
<script type="text/javascript">
7
//<![CDATA[
8
$(document).ready(function(){
9
    [% IF ( CAN_user_borrowers ) %]
10
        [% IF ( NorwegianPatronDBEnable == 1 ) %]
11
            $("#deletepatronlocal").click(function(){
12
                confirm_local_deletion();
13
                $(".btn-group").removeClass("open");
14
                return false;
15
            });
16
            $("#deletepatronremote").click(function(){
17
                confirm_remote_deletion();
18
                $(".btn-group").removeClass("open");
19
                return false;
20
            });
21
            $("#deletepatronboth").click(function(){
22
                confirm_both_deletion();
23
                $(".btn-group").removeClass("open");
24
                return false;
25
            });
26
        [% ELSE %]
27
            $("#deletepatron").click(function(){
28
                window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber | url%]';
29
            });
30
        [% END %]
31
        $("#renewpatron").click(function(){
32
            confirm_reregistration();
33
            $(".btn-group").removeClass("open");
34
            return false;
35
        });
36
        [% IF ( is_child ) %]$("#updatechild").click(function(){
37
            update_child();
38
            $(".btn-group").removeClass("open");
39
        });[% END %]
40
    [% END %]
41
    $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip();
42
    $("#exportcheckins").click(function(){
43
        export_barcodes();
44
        $(".btn-group").removeClass("open");
45
        return false;
46
    });
47
    $("#printsummary").click(function(){
48
        printx_window("page");
49
        $(".btn-group").removeClass("open");
50
        return false;
51
    });
52
    $("#printslip").click(function(){
53
        printx_window("slip");
54
        $(".btn-group").removeClass("open");
55
        return false;
56
    });
57
    $("#printquickslip").click(function(){
58
        printx_window("qslip");
59
        $(".btn-group").removeClass("open");
60
        return false;
61
    });
62
    $("#print_overdues").click(function(){
63
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=[% borrowernumber %]", "printwindow");
64
        $(".btn-group").removeClass("open");
65
        return false;
66
    });
67
    $("#searchtohold").click(function(){
68
        searchToHold();
69
        return false;
70
    });
71
    $("#select_patron_messages").on("change",function(){
72
        $("#borrower_message").val( $(this).val() );
73
    });
74
});
75
function confirm_local_deletion() {
76
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
77
    if (is_confirmed) {
78
        window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=false';
79
    }
80
}
81
function confirm_remote_deletion() {
82
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
83
    if (is_confirmed) {
84
        window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=false&deleteremote=true';
85
    }
86
}
87
function confirm_both_deletion() {
88
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron both from the local database and from the Norwegian national patron database? This cannot be undone."));
89
    if (is_confirmed) {
90
        window.location='/cgi-bin/koha/members/deletemem.pl?member=[% borrowernumber %]&deletelocal=true&deleteremote=true';
91
    }
92
}
93
94
[% IF ( is_child ) %]function confirm_updatechild() {
95
    var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category?  This cannot be undone."));
96
    if (is_confirmed) {
97
        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
98
    }
99
}
100
101
function update_child() {
102
    [% IF ( CATCODE_MULTI ) %]
103
        window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=[% borrowernumber %]','UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
104
    [% ELSE %]
105
        confirm_updatechild();
106
    [% END %]
107
}
108
[% END %]
109
110
function confirm_reregistration() {
111
    var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
112
    if (is_confirmed) {
113
    window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;destination=[% destination %]&amp;reregistration=y';
114
    }
115
}
116
function export_barcodes() {
117
    window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&amp;op=export_barcodes');
118
}
119
var slip_re = /slip/;
120
function printx_window(print_type) {
121
    var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
122
    window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&amp;print=" + print_type, "printwindow");
123
    return false;
124
}
125
function searchToHold(){
126
    var date = new Date();
127
    date.setTime(date.getTime() + (10 * 60 * 1000));
128
    $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date });
129
    location.href="/cgi-bin/koha/catalogue/search.pl";
130
}
131
//]]>
132
</script>
133
134
<div id="toolbar" class="btn-toolbar">
6
<div id="toolbar" class="btn-toolbar">
135
    [% IF ( CAN_user_borrowers ) %]
7
    [% IF ( CAN_user_borrowers ) %]
136
        [% IF ( guarantor ) %]
8
        [% IF ( guarantor ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (-24 / +1 lines)
Lines 1-28 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
<!-- snippet for form to set borrower and patron category messaging preferences -->
2
<!-- snippet for form to set borrower and patron category messaging preferences -->
3
<script type="text/javascript">//<![CDATA[
4
$(document).ready(function(){
5
    $(".none").click(function(){
6
        if($(this).prop("checked")){
7
            var rowid = $(this).attr("id");
8
            newid = Number(rowid.replace("none",""));
9
            $("#sms"+newid).prop("checked", false);
10
            $("#email"+newid).prop("checked", false);
11
            $("#phone"+newid).prop("checked", false);
12
            $("#digest"+newid).prop("checked", false);
13
            $("#rss"+newid).prop("checked", false);
14
        }
15
    });
16
    $(".active_notify").on("change",function(){
17
        var attr_id = $(this).data("attr-id");
18
        if( $(this).prop("checked") ){
19
            $("#none" + attr_id ).prop("checked", false);
20
        }
21
    });
22
    $("#info_digests").tooltip();
23
});
24
//]]>
25
</script>
26
3
27
<input type="hidden" name="modify" value="yes" />
4
<input type="hidden" name="modify" value="yes" />
28
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
5
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
Lines 32-38 $(document).ready(function(){ Link Here
32
        [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %]
9
        [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %]
33
        [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]<th>Phone</th>[% END %]
10
        [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]<th>Phone</th>[% END %]
34
        <th>Email</th>
11
        <th>Email</th>
35
        <th>Digests only <i id="info_digests" data-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single message." data-placement="right" class="icon fa fa-info-sign"></i></th>
12
        <th>Digests only <i id="info_digests" data-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single message." data-placement="right" class="fa fa-info-circle"></i></th>
36
        <!-- <th>RSS</th> -->
13
        <!-- <th>RSS</th> -->
37
        [% UNLESS ( messaging_form_inactive ) %]<th>Do not notify</th>[% END %]
14
        [% UNLESS ( messaging_form_inactive ) %]<th>Do not notify</th>[% END %]
38
    </tr>
15
    </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-33 / +11 lines)
Lines 155-191 Link Here
155
    </ul>
155
    </ul>
156
</div><!-- /header_search -->
156
</div><!-- /header_search -->
157
</div><!-- /gradient -->
157
</div><!-- /gradient -->
158
<script type="text/javascript">//<![CDATA[
159
$(document).ready(function() {
160
    $("#filteraction_off, #filteraction_on").on('click', function(e) {
161
        e.preventDefault();
162
        $('#filters').toggle();
163
        $('.filteraction').toggle();
164
    });
165
    [% IF ( advsearch ) %]
166
        $("#filteraction_on").toggle();
167
        $("#filters").show();
168
    [% ELSE %]
169
        $("#filteraction_off").toggle();
170
    [% END %]
171
    [% SET dateformat = Koha.Preference('dateformat') %]
172
    $("#searchfieldstype").change(function() {
173
      if ( $(this).val() == 'dateofbirth' ) {
174
          [% IF dateformat == 'us' %]
175
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'");
176
          [% ELSIF dateformat == 'iso' %]
177
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
178
          [% ELSIF dateformat == 'metric' %]
179
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
180
          [% ELSIF dateformat == 'dmydot' %]
181
              var MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'");
182
          [% END %]
183
          $('#searchmember').attr("title",MSG_DATE_FORMAT).tooltip('show');
184
      } else {
185
          $('#searchmember').tooltip('destroy');
186
      }
187
    });
188
});
189
//]]>
190
</script>
191
<!-- 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 = "[% CAN_user_borrowers %]";
166
    var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
167
    var CATCODE_MULTI = "[% CATCODE_MULTI %]";
168
    var borrowernumber = "[% borrowernumber %]";
169
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+1 lines)
Lines 492-497 Link Here
492
492
493
[% MACRO jsinclude BLOCK %]
493
[% MACRO jsinclude BLOCK %]
494
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
494
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
495
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/messaging-preference-form.js"></script>
495
    [% INCLUDE 'calendar.inc' %]
496
    [% INCLUDE 'calendar.inc' %]
496
    [% INCLUDE 'datatables.inc' %]
497
    [% INCLUDE 'datatables.inc' %]
497
    <script type="text/javascript">
498
    <script type="text/javascript">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/common/patron_search.tt (-165 / +166 lines)
Lines 1-175 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patron search</title>
5
<title>Koha &rsaquo; Patron search</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
8
9
<script type="text/javascript">
10
//<![CDATA[
11
12
var search = 1;
13
$(document).ready(function(){
14
    $("#info").hide();
15
    $("#error").hide();
16
17
    [% IF view != "show_results" %]
18
        $("#searchresults").hide();
19
        search = 0;
20
    [% END %]
21
22
    // Apply DataTables on the results table
23
    dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
24
        'bServerSide': true,
25
        'sAjaxSource': "/cgi-bin/koha/svc/members/search",
26
        'fnServerData': function(sSource, aoData, fnCallback) {
27
            if ( ! search ) {
28
                return;
29
            }
30
            aoData.push({
31
                'name': 'searchmember',
32
                'value': $("#searchmember_filter").val()
33
            },{
34
                'name': 'firstletter',
35
                'value': $("#firstletter_filter").val()
36
            },{
37
                'name': 'categorycode',
38
                'value': $("#categorycode_filter").val()
39
            },{
40
                'name': 'branchcode',
41
                'value': $("#branchcode_filter").val()
42
            },{
43
                'name': 'name_sorton',
44
                'value': 'borrowers.surname borrowers.firstname'
45
            },{
46
                'name': 'category_sorton',
47
                'value': 'categories.description',
48
            },{
49
                'name': 'branch_sorton',
50
                'value': 'branches.branchname'
51
            },{
52
                'name': 'template_path',
53
                'value': '[% json_template %]',
54
            },{
55
                'name': 'selection_type',
56
                'value': '[% selection_type %]',
57
            }
58
            [% IF patrons_with_acq_perm_only %]
59
            ,{
60
                'name': 'has_permission',
61
                'value': 'acquisition.order_manage',
62
            }
63
            [% END %]
64
            );
65
            $.ajax({
66
                'dataType': 'json',
67
                'type': 'POST',
68
                'url': sSource,
69
                'data': aoData,
70
                'success': function(json){
71
                    fnCallback(json);
72
                }
73
            });
74
        },
75
        'aoColumns':[
76
            [% FOR column IN columns %]
77
                [% IF column == 'action' %]
78
                    { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
79
                [% ELSIF column == 'address' %]
80
                    { 'mDataProp': 'dt_address', 'bSortable': false }
81
                [% ELSE %]
82
                    { 'mDataProp': 'dt_[% column %]' }
83
                [% END %]
84
                [% UNLESS loop.last %],[% END %]
85
            [% END %]
86
        ],
87
        'bAutoWidth': false,
88
        [% IF patrons_with_acq_perm_only %]
89
            'bPaginate': false,
90
        [% ELSE %]
91
            'sPaginationType': 'full_numbers',
92
            "iDisplayLength": [% Koha.Preference('PatronsPerPage') %],
93
        [% END %]
94
        'aaSorting': [[[% aaSorting || 0 %], 'asc']],
95
        'bFilter': false,
96
        'bProcessing': true,
97
    }));
98
99
    $("#searchform").on('submit', filter);
100
    $(".filterByLetter").on("click",function(e){
101
        e.preventDefault();
102
        filterByFirstLetterSurname($(this).text());
103
    });
104
    $("body").on("click",".add_user",function(e){
105
        e.preventDefault();
106
        var borrowernumber = $(this).data("borrowernumber");
107
        var firstname = $(this).data("firstname");
108
        var surname = $(this).data("surname");
109
        add_user( borrowernumber, firstname + " " + surname );
110
    });
111
112
    $("body").on("click",".select_user",function(e){
113
        e.preventDefault();
114
        var borrowernumber = $(this).data("borrowernumber");
115
        var borrower_data = $("#borrower_data"+borrowernumber).val();
116
        select_user( borrowernumber, JSON.parse(borrower_data) );
117
    });
118
119
});
120
121
function filter() {
122
    search = 1;
123
    $("#firstletter_filter").val('');
124
    $("#searchresults").show();
125
    dtMemberResults.fnDraw();
126
    return false;
127
}
128
129
// User has clicked on a letter
130
function filterByFirstLetterSurname(letter) {
131
    $("#firstletter_filter").val(letter);
132
    search = 1;
133
    $("#searchresults").show();
134
    dtMemberResults.fnDraw();
135
}
136
137
138
    // modify parent window owner element
139
    [% IF selection_type == 'add' %]
140
        function add_user(borrowernumber, borrowername) {
141
            var p = window.opener;
142
            // In one place (serials/routing.tt), the page is reload on every add
143
            // We have to wait for the page to be there
144
            function wait_for_opener () {
145
                if ( ! $(opener.document).find('body').size() ) {
146
                    setTimeout(wait_for_opener, 500);
147
                } else {
148
                    [%# Note that add_user could sent data instead of borrowername too %]
149
                    $("#info").hide();
150
                    $("#error").hide();
151
                    if ( p.add_user(borrowernumber, borrowername) < 0 ) {
152
                        $("#error").html(_("Patron '%s' is already in the list.").format(borrowername));
153
                        $("#error").show();
154
                    } else {
155
                        $("#info").html(_("Patron '%s' added.").format(borrowername));
156
                        $("#info").show();
157
                    }
158
                }
159
            }
160
            wait_for_opener();
161
        }
162
    [% ELSIF selection_type == 'select' %]
163
        function select_user(borrowernumber, data) {
164
            var p = window.opener;
165
            p.select_user(borrowernumber, data);
166
            window.close();
167
        }
168
    [% END %]
169
//]]>
170
</script>
171
172
</head>
8
</head>
9
173
<body id="common_patron_search" class="common">
10
<body id="common_patron_search" class="common">
174
<div id="patron_search" class="yui-t7">
11
<div id="patron_search" class="yui-t7">
175
  <div id="bd">
12
  <div id="bd">
Lines 252-256 function filterByFirstLetterSurname(letter) { Link Here
252
<div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div>
89
<div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div>
253
</div>
90
</div>
254
</div>
91
</div>
92
93
[% MACRO jsinclude BLOCK %]
94
    [% INCLUDE 'datatables.inc' %]
95
96
    <script type="text/javascript">
97
        var search = 1;
98
        $(document).ready(function(){
99
            $("#info").hide();
100
            $("#error").hide();
101
102
            [% IF view != "show_results" %]
103
                $("#searchresults").hide();
104
                search = 0;
105
            [% END %]
106
107
            // Apply DataTables on the results table
108
            dtMemberResults = $("#memberresultst").dataTable($.extend(true, {}, dataTablesDefaults, {
109
                'bServerSide': true,
110
                'sAjaxSource': "/cgi-bin/koha/svc/members/search",
111
                'fnServerData': function(sSource, aoData, fnCallback) {
112
                    if ( ! search ) {
113
                        return;
114
                    }
115
                    aoData.push({
116
                        'name': 'searchmember',
117
                        'value': $("#searchmember_filter").val()
118
                    },{
119
                        'name': 'firstletter',
120
                        'value': $("#firstletter_filter").val()
121
                    },{
122
                        'name': 'categorycode',
123
                        'value': $("#categorycode_filter").val()
124
                    },{
125
                        'name': 'branchcode',
126
                        'value': $("#branchcode_filter").val()
127
                    },{
128
                        'name': 'name_sorton',
129
                        'value': 'borrowers.surname borrowers.firstname'
130
                    },{
131
                        'name': 'category_sorton',
132
                        'value': 'categories.description',
133
                    },{
134
                        'name': 'branch_sorton',
135
                        'value': 'branches.branchname'
136
                    },{
137
                        'name': 'template_path',
138
                        'value': '[% json_template %]',
139
                    },{
140
                        'name': 'selection_type',
141
                        'value': '[% selection_type %]',
142
                    }
143
                    [% IF patrons_with_acq_perm_only %]
144
                    ,{
145
                        'name': 'has_permission',
146
                        'value': 'acquisition.order_manage',
147
                    }
148
                    [% END %]
149
                    );
150
                    $.ajax({
151
                        'dataType': 'json',
152
                        'type': 'POST',
153
                        'url': sSource,
154
                        'data': aoData,
155
                        'success': function(json){
156
                            fnCallback(json);
157
                        }
158
                    });
159
                },
160
                'aoColumns':[
161
                    [% FOR column IN columns %]
162
                        [% IF column == 'action' %]
163
                            { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
164
                        [% ELSIF column == 'address' %]
165
                            { 'mDataProp': 'dt_address', 'bSortable': false }
166
                        [% ELSE %]
167
                            { 'mDataProp': 'dt_[% column %]' }
168
                        [% END %]
169
                        [% UNLESS loop.last %],[% END %]
170
                    [% END %]
171
                ],
172
                'bAutoWidth': false,
173
                [% IF patrons_with_acq_perm_only %]
174
                    'bPaginate': false,
175
                [% ELSE %]
176
                    'sPaginationType': 'full_numbers',
177
                    "iDisplayLength": [% Koha.Preference('PatronsPerPage') %],
178
                [% END %]
179
                'aaSorting': [[[% aaSorting || 0 %], 'asc']],
180
                'bFilter': false,
181
                'bProcessing': true,
182
            }));
183
184
            $("#searchform").on('submit', filter);
185
            $(".filterByLetter").on("click",function(e){
186
                e.preventDefault();
187
                filterByFirstLetterSurname($(this).text());
188
            });
189
            $("body").on("click",".add_user",function(e){
190
                e.preventDefault();
191
                var borrowernumber = $(this).data("borrowernumber");
192
                var firstname = $(this).data("firstname");
193
                var surname = $(this).data("surname");
194
                add_user( borrowernumber, firstname + " " + surname );
195
            });
196
197
            $("body").on("click",".select_user",function(e){
198
                e.preventDefault();
199
                var borrowernumber = $(this).data("borrowernumber");
200
                var borrower_data = $("#borrower_data"+borrowernumber).val();
201
                select_user( borrowernumber, JSON.parse(borrower_data) );
202
            });
203
204
        });
205
206
        function filter() {
207
            search = 1;
208
            $("#firstletter_filter").val('');
209
            $("#searchresults").show();
210
            dtMemberResults.fnDraw();
211
            return false;
212
        }
213
214
        // User has clicked on a letter
215
        function filterByFirstLetterSurname(letter) {
216
            $("#firstletter_filter").val(letter);
217
            search = 1;
218
            $("#searchresults").show();
219
            dtMemberResults.fnDraw();
220
        }
221
222
        // modify parent window owner element
223
        [% IF selection_type == 'add' %]
224
            function add_user(borrowernumber, borrowername) {
225
                var p = window.opener;
226
                // In one place (serials/routing.tt), the page is reload on every add
227
                // We have to wait for the page to be there
228
                function wait_for_opener () {
229
                    if ( ! $(opener.document).find('body').size() ) {
230
                        setTimeout(wait_for_opener, 500);
231
                    } else {
232
                        [%# Note that add_user could sent data instead of borrowername too %]
233
                        $("#info").hide();
234
                        $("#error").hide();
235
                        if ( p.add_user(borrowernumber, borrowername) < 0 ) {
236
                            $("#error").html(_("Patron '%s' is already in the list.").format(borrowername));
237
                            $("#error").show();
238
                        } else {
239
                            $("#info").html(_("Patron '%s' added.").format(borrowername));
240
                            $("#info").show();
241
                        }
242
                    }
243
                }
244
                wait_for_opener();
245
            }
246
        [% ELSIF selection_type == 'select' %]
247
            function select_user(borrowernumber, data) {
248
                var p = window.opener;
249
                p.select_user(borrowernumber, data);
250
                window.close();
251
            }
252
        [% END %]
253
    </script>
254
[% END %]
255
255
[% SET popup_window = 1 %]
256
[% SET popup_window = 1 %]
256
[% INCLUDE 'intranet-bottom.inc' %]
257
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-33 / +40 lines)
Lines 2-43 Link Here
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE ColumnsSettings %]
3
[% USE ColumnsSettings %]
4
[% USE Price %]
4
[% USE Price %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
7
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
<script type="text/javascript">
12
$(document).ready(function() {
13
    var txtActivefilter = _("Filter paid transactions");
14
    var txtInactivefilter = _("Show all transactions");
15
    var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
16
    var table_account_fines = KohaTable("#table_account_fines", {
17
        "sPaginationType": "four_button",
18
        'aaSorting': [[0, 'desc']],
19
        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
20
        "aoColumnDefs": [
21
            { "sType": "title-string", "aTargets" : [ "title-string" ] },
22
            { "bSortable": false, "bSearchable": false, "aTargets": [-1] }
23
        ]
24
    }, columns_settings);
25
    $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
26
    $('#filter_transacs').click(function(e) {
27
        e.preventDefault();
28
        if ($(this).hasClass('filtered')) {
29
            var filteredValue = '';
30
            $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
31
        } else { //Not filtered. Let's do it!
32
            var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
33
            $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
34
        }
35
        table_account_fines.fnFilter(filteredValue, 4, true, false);
36
        $(this).toggleClass('filtered');
37
    });
38
});
39
</script>
40
</head>
10
</head>
11
41
<body id="pat_borraccount" class="pat">
12
<body id="pat_borraccount" class="pat">
42
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'header.inc' %]
43
[% INCLUDE 'patron-search.inc' %]
14
[% INCLUDE 'patron-search.inc' %]
Lines 45-51 $(document).ready(function() { Link Here
45
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</div>
16
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</div>
46
17
47
<div id="doc3" class="yui-t2">
18
<div id="doc3" class="yui-t2">
48
   
49
   <div id="bd">
19
   <div id="bd">
50
	<div id="yui-main">
20
	<div id="yui-main">
51
	<div class="yui-b">
21
	<div class="yui-b">
Lines 121-127 $(document).ready(function() { Link Here
121
        [% IF ( reverse_col) %]
91
        [% IF ( reverse_col) %]
122
          [% IF ( account.payment ) %]
92
          [% IF ( account.payment ) %]
123
            <a href="boraccount.pl?action=reverse&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a>
93
            <a href="boraccount.pl?action=reverse&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-undo"></i> Reverse</a>
124
          [% ELSE %]
94
          [% ELSE %][% SET footerjs = 1 %]
125
            &nbsp;
95
            &nbsp;
126
          [% END %]
96
          [% END %]
127
        [% END %]
97
        [% END %]
Lines 150-153 $(document).ready(function() { Link Here
150
[% INCLUDE 'circ-menu.inc' %]
120
[% INCLUDE 'circ-menu.inc' %]
151
</div>
121
</div>
152
</div>
122
</div>
123
124
[% MACRO jsinclude BLOCK %]
125
    [% INCLUDE 'datatables.inc' %]
126
    [% INCLUDE 'columns_settings.inc' %]
127
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
128
    <script type="text/javascript">
129
        var dateformat = "[% Koha.Preference('dateformat') %]";
130
        $(document).ready(function() {
131
            var txtActivefilter = _("Filter paid transactions");
132
            var txtInactivefilter = _("Show all transactions");
133
            var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
134
            var table_account_fines = KohaTable("#table_account_fines", {
135
                "sPaginationType": "four_button",
136
                'aaSorting': [[0, 'desc']],
137
                "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
138
                "aoColumnDefs": [
139
                    { "sType": "title-string", "aTargets" : [ "title-string" ] },
140
                    { "bSortable": false, "bSearchable": false, "aTargets": [-1] }
141
                ]
142
            }, columns_settings);
143
            $("#filter_c").html('<p><a href="#" id="filter_transacs"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
144
            $('#filter_transacs').click(function(e) {
145
                e.preventDefault();
146
                if ($(this).hasClass('filtered')) {
147
                    var filteredValue = '';
148
                    $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
149
                } else { //Not filtered. Let's do it!
150
                    var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
151
                    $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
152
                }
153
                table_account_fines.fnFilter(filteredValue, 4, true, false);
154
                $(this).toggleClass('filtered');
155
            });
156
        });
157
    </script>
158
[% END %]
159
153
[% INCLUDE 'intranet-bottom.inc' %]
160
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt (+6 lines)
Lines 1-3 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Delete patron [% firstname %] [% surname %]</title>
3
<title>Koha &rsaquo; Delete patron [% firstname %] [% surname %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 57-60 Link Here
57
[% INCLUDE 'circ-menu.inc' %]
58
[% INCLUDE 'circ-menu.inc' %]
58
</div>
59
</div>
59
</div>
60
</div>
61
62
[% MACRO jsinclude BLOCK %]
63
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
64
[% END %]
65
60
[% INCLUDE 'intranet-bottom.inc' %]
66
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt (+6 lines)
Lines 1-6 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo; [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
6
<title>Koha &rsaquo; Patrons &rsaquo; [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
Lines 70-73 Link Here
70
[% INCLUDE 'circ-menu.inc' %]
71
[% INCLUDE 'circ-menu.inc' %]
71
</div>
72
</div>
72
</div>
73
</div>
74
75
[% MACRO jsinclude BLOCK %]
76
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
77
[% END %]
78
73
[% INCLUDE 'intranet-bottom.inc' %]
79
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt (+6 lines)
Lines 1-4 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Patrons &rsaquo; Pending discharge requests</title>
4
<title>Koha &rsaquo; Patrons &rsaquo; Pending discharge requests</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 39-42 Link Here
39
    [% END %]
40
    [% END %]
40
  </div>
41
  </div>
41
</div>
42
</div>
43
44
[% MACRO jsinclude BLOCK %]
45
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
46
[% END %]
47
42
[% INCLUDE 'intranet-bottom.inc' %]
48
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/files.tt (-13 / +20 lines)
Lines 1-22 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Files for [% INCLUDE 'patron-title.inc' %]</title>
5
<title>Files for [% INCLUDE 'patron-title.inc' %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript">
7
    $(document).ready(function(){
8
        $(".confirmdelete").on("click", function(){
9
            $(this).parents('tr').addClass("warn");
10
            if(confirm(_("Are you sure you want to delete this file?"))){
11
                return true;
12
            } else {
13
                $(this).parents('tr').removeClass("warn");
14
                return false;
15
            }
16
        });
17
});
18
</script>
19
</head>
7
</head>
8
20
<body id="pat_files" class="pat">
9
<body id="pat_files" class="pat">
21
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'header.inc' %]
22
[% INCLUDE 'patron-search.inc' %]
11
[% INCLUDE 'patron-search.inc' %]
Lines 93-96 Link Here
93
            [% INCLUDE 'circ-menu.inc' %]
82
            [% INCLUDE 'circ-menu.inc' %]
94
        </div>
83
        </div>
95
    </div>
84
    </div>
85
86
[% MACRO jsinclude BLOCK %]
87
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
88
    <script type="text/javascript">
89
        $(document).ready(function(){
90
            $(".confirmdelete").on("click", function(){
91
                $(this).parents('tr').addClass("warn");
92
                if(confirm(_("Are you sure you want to delete this file?"))){
93
                    return true;
94
                } else {
95
                    $(this).parents('tr').removeClass("warn");
96
                    return false;
97
                }
98
            });
99
    });
100
    </script>
101
[% END %]
102
96
[% INCLUDE 'intranet-bottom.inc' %]
103
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt (-19 / +23 lines)
Lines 3-32 Link Here
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE ColumnsSettings %]
5
[% USE ColumnsSettings %]
6
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Holds history for [% INCLUDE 'patron-title.inc' %]</title>
8
<title>Holds history for [% INCLUDE 'patron-title.inc' %]</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
11
[% INCLUDE 'columns_settings.inc' %]
12
<script type="text/javascript" id="js">
13
//<![CDATA[
14
15
 $(document).ready(function() {
16
    var columns_settings = [% ColumnsSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %];
17
    var table = KohaTable("#table_holdshistory", {
18
        "sPaginationType": "four_button",
19
        "aaSorting": [[4, 'desc']],
20
        "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
21
        "aoColumnDefs": [
22
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
23
            { "sType": "title-string", "aTargets" : [ "title-string" ] }
24
        ]
25
    }, columns_settings);
26
 });
27
//]]>
28
</script>
29
</head>
11
</head>
12
30
<body id="pat_holdshistory" class="pat">
13
<body id="pat_holdshistory" class="pat">
31
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'header.inc' %]
32
[% INCLUDE 'patron-search.inc' %]
15
[% INCLUDE 'patron-search.inc' %]
Lines 118-121 Link Here
118
[% INCLUDE 'circ-menu.inc' %]
101
[% INCLUDE 'circ-menu.inc' %]
119
</div>
102
</div>
120
</div>
103
</div>
104
105
[% MACRO jsinclude BLOCK %]
106
    [% INCLUDE 'datatables.inc' %]
107
    [% INCLUDE 'columns_settings.inc' %]
108
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
109
    <script type="text/javascript" id="js">
110
        $(document).ready(function() {
111
            var columns_settings = [% ColumnsSettings.GetColumns('members', 'holdshistory', 'holdshistory-table', 'json') %];
112
            var table = KohaTable("#table_holdshistory", {
113
                "sPaginationType": "four_button",
114
                "aaSorting": [[4, 'desc']],
115
                "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
116
                "aoColumnDefs": [
117
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
118
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
119
                ]
120
            }, columns_settings);
121
        });
122
    </script>
123
[% END %]
124
121
[% INCLUDE 'intranet-bottom.inc' %]
125
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt (-10 / +15 lines)
Lines 1-20 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Housebound &rsaquo; Details for [% INCLUDE 'patron-title.inc' %]</title>
6
<title>Koha &rsaquo; Housebound &rsaquo; Details for [% INCLUDE 'patron-title.inc' %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'calendar.inc' %]
8
<script type="text/javascript">
9
//<![CDATA[
10
    $(document).ready(function() {
11
        $("a.delete").click(function(){
12
            return confirm(_("Are you sure you want to delete this delivery?"));
13
        });
14
    });
15
//]]>
16
</script>
17
</head>
8
</head>
9
18
<body id="housebound-home" class="housebound">
10
<body id="housebound-home" class="housebound">
19
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
20
[% INCLUDE 'patron-search.inc' %]
12
[% INCLUDE 'patron-search.inc' %]
Lines 434-437 Link Here
434
    [% INCLUDE 'circ-menu.inc' %]
426
    [% INCLUDE 'circ-menu.inc' %]
435
  </div>
427
  </div>
436
</div>
428
</div>
429
430
[% MACRO jsinclude BLOCK %]
431
    [% INCLUDE 'calendar.inc' %]
432
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
433
    <script type="text/javascript">
434
        $(document).ready(function() {
435
            $("a.delete").click(function(){
436
                return confirm(_("Are you sure you want to delete this delivery?"));
437
            });
438
        });
439
    </script>
440
[% END %]
441
437
[% INCLUDE 'intranet-bottom.inc' %]
442
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-8 / +13 lines)
Lines 1-16 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript">
6
//<![CDATA[
7
$(document).ready(function(){
8
        $('#mancredit').preventDoubleFormSubmit();
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
10
});
11
//]]>
12
</script>
13
</head>
6
</head>
7
14
<body id="pat_mancredit" class="pat">
8
<body id="pat_mancredit" class="pat">
15
[% INCLUDE 'header.inc' %]
9
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'patron-search.inc' %]
10
[% INCLUDE 'patron-search.inc' %]
Lines 61-64 $(document).ready(function(){ Link Here
61
[% INCLUDE 'circ-menu.inc' %]
55
[% INCLUDE 'circ-menu.inc' %]
62
</div>
56
</div>
63
</div>
57
</div>
58
59
[% MACRO jsinclude BLOCK %]
60
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
61
    <script type="text/javascript">
62
        $(document).ready(function(){
63
            $('#mancredit').preventDoubleFormSubmit();
64
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
65
        });
66
    </script>
67
[% END %]
68
64
[% INCLUDE 'intranet-bottom.inc' %]
69
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-16 / +21 lines)
Lines 1-24 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Patrons &rsaquo; Create manual invoice</title>
4
<title>Koha &rsaquo; Patrons &rsaquo; Create manual invoice</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript">
6
//<![CDATA[
7
    var type_fees = {'L':'','F':'','A':'','N':'','M':''};
8
    [% FOREACH invoice_types_loo IN invoice_types_loop %]
9
        type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
10
    [% END %]
11
$(document).ready(function(){
12
        $('#maninvoice').preventDoubleFormSubmit();
13
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
14
    $("#invoice_type").on("change",function(){
15
        this.form.desc.value = this.options[this.selectedIndex].value;
16
        this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
17
    });
18
});
19
//]]>
20
</script>
21
</head>
6
</head>
7
22
<body id="pat_maninvoice" class="pat">
8
<body id="pat_maninvoice" class="pat">
23
[% INCLUDE 'header.inc' %]
9
[% INCLUDE 'header.inc' %]
24
[% INCLUDE 'patron-search.inc' %]
10
[% INCLUDE 'patron-search.inc' %]
Lines 82-85 $(document).ready(function(){ Link Here
82
[% INCLUDE 'circ-menu.inc' %]
68
[% INCLUDE 'circ-menu.inc' %]
83
</div>
69
</div>
84
</div>
70
</div>
71
72
[% MACRO jsinclude BLOCK %]
73
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
74
    <script type="text/javascript">
75
        var type_fees = {'L':'','F':'','A':'','N':'','M':''};
76
        [% FOREACH invoice_types_loo IN invoice_types_loop %]
77
            type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
78
        [% END %]
79
        $(document).ready(function(){
80
            $('#maninvoice').preventDoubleFormSubmit();
81
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
82
            $("#invoice_type").on("change",function(){
83
                this.form.desc.value = this.options[this.selectedIndex].value;
84
                this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
85
            });
86
        });
87
    </script>
88
[% END %]
89
85
[% INCLUDE 'intranet-bottom.inc' %]
90
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt (-103 / +109 lines)
Lines 1-113 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% SET footerjs = 1 %]
2
[% PROCESS 'permissions.inc' %]
3
[% PROCESS 'permissions.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; Set permissions for [% surname %], [% firstname %]</title>
5
<title>Koha &rsaquo; Patrons &rsaquo; Set permissions for [% surname %], [% firstname %]</title>
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/treeview/jquery.treeview.css"/>
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/treeview/jquery.treeview.css"/>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.treeview.pack.js"></script>
8
<!-- set up tree -->
9
<script type="text/javascript">
10
    $(document).ready(function() {
11
        $("#permissionstree").treeview({animated: "fast", collapsed: true});
12
13
        // Enforce Superlibrarian Privilege Mutual Exclusivity
14
        if($('input[id="flag-0"]:checked').length){
15
            if ($('input[name="flag"]:checked').length > 1){
16
                alert(_("Inconsistency detected! The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all. This patron's privileges will now be reset to include only superlibrarian."));
17
            }
18
19
            $('input[name="flag"]').each(function() {
20
                if($(this).attr('id') != "flag-0"){
21
                    $(this).prop('disabled', true);
22
                    $(this).prop('checked', false);
23
                }
24
            });
25
        }
26
27
        $('input#flag-0').click(function() {
28
            if($('input[id="flag-0"]:checked').length){
29
                $('input[name="flag"]').each(function() {
30
                    if($(this).attr('id') != "flag-0"){
31
                        $(this).prop('disabled', true);
32
                        $(this).prop('checked', false);
33
                    }
34
                });
35
            }
36
            else {
37
                $('input[name="flag"]').each(function() {
38
                    $(this).prop('disabled', false);
39
                });
40
            }
41
        });
42
43
        $(".flag").on("change",function(){
44
            if( $(this).hasClass("parent") ){
45
                toggleChildren(this);
46
            } else {
47
                toggleParent(this);
48
            }
49
        });
50
51
    });
52
53
    // manage checking/unchecking parent permissions
54
    var originalChildStates = {}; /* keep track of subpermission checkbox values
55
                                     so that user can recover from accidentally
56
                                     toggling a parent/module permission */
57
    function selectChildren(parentInput) {
58
        var childListId = parentInput.id + '-children';
59
        var list = document.getElementById(childListId);
60
        var children = [];
61
        if (list) {
62
            var inputs = list.getElementsByTagName('input');
63
            for (var i = 0; i < inputs.length; i++) {
64
                if (inputs[i].type == 'checkbox') {
65
                    children.push(inputs[i]);
66
                }
67
            }
68
            
69
        } 
70
        return children;
71
    }
72
73
    function toggleChildren(parentInput) {
74
        var children = selectChildren(parentInput);
75
        if (children.length == 0) {
76
            return;
77
        }
78
        var checked = parentInput.checked;
79
        if (checked && parentInput.parentNode.className == 'expandable') {
80
            /* expand the tree */
81
            $(".hitarea", parentInput.parentNode).click();
82
        }
83
        for (var i = 0; i < children.length; i++) {
84
            if (checked) {
85
                originalChildStates[children[i].id] = children[i].checked;
86
                children[i].checked = checked;
87
            } else {
88
                if (children[i].id in originalChildStates) {
89
                    children[i].checked = originalChildStates[children[i].id];
90
                } else {
91
                    children[i].checked = checked;
92
                }
93
            }
94
        }
95
    }
96
97
    function toggleParent(childInput) {
98
        originalChildStates[childInput.id] = childInput.checked;
99
        if (childInput.checked) {
100
            return;
101
        }
102
        var parentId = childInput.parentNode.parentNode.id.replace(/-children$/, '');;
103
        var parentInput = document.getElementById(parentId);
104
        if (parentInput) {  
105
            parentInput.checked = false;
106
        }
107
    }
108
109
</script>
110
</head>
8
</head>
9
111
<body id="pat_member-flags" class="pat">
10
<body id="pat_member-flags" class="pat">
112
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
113
[% INCLUDE 'patron-search.inc' %]
12
[% INCLUDE 'patron-search.inc' %]
Lines 175-178 Link Here
175
[% INCLUDE 'circ-menu.inc' %]
74
[% INCLUDE 'circ-menu.inc' %]
176
</div>
75
</div>
177
</div>
76
</div>
77
78
[% MACRO jsinclude BLOCK %]
79
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
80
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.treeview.pack.js"></script>
81
    <!-- set up tree -->
82
    <script type="text/javascript">
83
        $(document).ready(function() {
84
            $("#permissionstree").treeview({animated: "fast", collapsed: true});
85
86
            // Enforce Superlibrarian Privilege Mutual Exclusivity
87
            if($('input[id="flag-0"]:checked').length){
88
                if ($('input[name="flag"]:checked').length > 1){
89
                    alert(_("Inconsistency detected! The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all. This patron's privileges will now be reset to include only superlibrarian."));
90
                }
91
92
                $('input[name="flag"]').each(function() {
93
                    if($(this).attr('id') != "flag-0"){
94
                        $(this).prop('disabled', true);
95
                        $(this).prop('checked', false);
96
                    }
97
                });
98
            }
99
100
            $('input#flag-0').click(function() {
101
                if($('input[id="flag-0"]:checked').length){
102
                    $('input[name="flag"]').each(function() {
103
                        if($(this).attr('id') != "flag-0"){
104
                            $(this).prop('disabled', true);
105
                            $(this).prop('checked', false);
106
                        }
107
                    });
108
                }
109
                else {
110
                    $('input[name="flag"]').each(function() {
111
                        $(this).prop('disabled', false);
112
                    });
113
                }
114
            });
115
116
            $(".flag").on("change",function(){
117
                if( $(this).hasClass("parent") ){
118
                    toggleChildren(this);
119
                } else {
120
                    toggleParent(this);
121
                }
122
            });
123
124
        });
125
126
        // manage checking/unchecking parent permissions
127
        var originalChildStates = {}; /* keep track of subpermission checkbox values
128
                                         so that user can recover from accidentally
129
                                         toggling a parent/module permission */
130
        function selectChildren(parentInput) {
131
            var childListId = parentInput.id + '-children';
132
            var list = document.getElementById(childListId);
133
            var children = [];
134
            if (list) {
135
                var inputs = list.getElementsByTagName('input');
136
                for (var i = 0; i < inputs.length; i++) {
137
                    if (inputs[i].type == 'checkbox') {
138
                        children.push(inputs[i]);
139
                    }
140
                }
141
            }
142
            return children;
143
        }
144
145
        function toggleChildren(parentInput) {
146
            var children = selectChildren(parentInput);
147
            if (children.length == 0) {
148
                return;
149
            }
150
            var checked = parentInput.checked;
151
            if (checked && parentInput.parentNode.className == 'expandable') {
152
                /* expand the tree */
153
                $(".hitarea", parentInput.parentNode).click();
154
            }
155
            for (var i = 0; i < children.length; i++) {
156
                if (checked) {
157
                    originalChildStates[children[i].id] = children[i].checked;
158
                    children[i].checked = checked;
159
                } else {
160
                    if (children[i].id in originalChildStates) {
161
                        children[i].checked = originalChildStates[children[i].id];
162
                    } else {
163
                        children[i].checked = checked;
164
                    }
165
                }
166
            }
167
        }
168
169
        function toggleParent(childInput) {
170
            originalChildStates[childInput.id] = childInput.checked;
171
            if (childInput.checked) {
172
                return;
173
            }
174
            var parentId = childInput.parentNode.parentNode.id.replace(/-children$/, '');;
175
            var parentInput = document.getElementById(parentId);
176
            if (parentInput) {
177
                parentInput.checked = false;
178
            }
179
        }
180
181
    </script>
182
[% END %]
183
178
[% INCLUDE 'intranet-bottom.inc' %]
184
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt (-62 / +67 lines)
Lines 1-69 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title>
5
<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/JavaScript">
7
//<![CDATA[
8
9
    function generate_password() {
10
        // Always generate a strong password
11
        var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
12
        var length = [% Koha.Preference('minPasswordLength') %];
13
        if ( length < 8 ) length = 8;
14
        var password='';
15
        for ( var i = 0 ; i < length ; i++){
16
            password += chars.charAt(Math.floor(Math.random()*chars.length));
17
        }
18
        return password;
19
    }
20
    $(document).ready(function() {
21
        $("body").on('click', "#fillrandom",function(e) {
22
            e.preventDefault();
23
            var password = '';
24
            var pattern_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{[% Koha.Preference('minPasswordLength') %],}/;
25
            while ( ! pattern_regex.test( password ) ) {
26
                password = generate_password();
27
            }
28
            $("#newpassword").val(password);
29
            $("#newpassword").attr('type', 'text');
30
            $("#newpassword2").val(password);
31
            $("#newpassword2").attr('type', 'text');
32
        });
33
        $("div.hint").eq(0).after(" <div class=\"hint\"><a href=\"#\" id=\"fillrandom\">"+_("Click to fill with a randomly generated suggestion. ")+"<strong>"+_("Passwords will be displayed as text")+"</strong>.</a></div>");
34
35
        $(document).ajaxStart(function () {
36
            $("input[name^=newpassword]").hide();
37
            $("label[for=newpassword2]").hide();
38
            $(".hint:last").after($(".loading").show());
39
        });
40
        $(document).ajaxStop(function () {
41
            $("input[name^=newpassword]").show();
42
            $("label[for=newpassword2]").show();
43
            $(".loading").hide();
44
            $("label.error").hide();
45
        });
46
        [% IF NOMATCH %]
47
            $("#newpassword").addClass('focus');
48
        [% END %]
49
50
        $("#changepasswordf").validate({
51
            rules: {
52
                newpassword: {
53
                    required: true,
54
                    password_strong: true,
55
                    password_no_spaces: true
56
                },
57
                newpassword2: {
58
                    required: true,
59
                    password_match: true
60
                }
61
            }
62
        });
63
    });
64
//]]>
65
</script>
66
</head>
7
</head>
8
67
<body id="pat_member-password" class="pat">
9
<body id="pat_member-password" class="pat">
68
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'header.inc' %]
69
[% INCLUDE 'patron-search.inc' %]
11
[% INCLUDE 'patron-search.inc' %]
Lines 146-151 Link Here
146
[% INCLUDE 'circ-menu.inc' %]
88
[% INCLUDE 'circ-menu.inc' %]
147
</div>
89
</div>
148
</div>
90
</div>
91
92
[% MACRO jsinclude BLOCK %]
93
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
94
    <script type="text/JavaScript">
95
96
        function generate_password() {
97
            // Always generate a strong password
98
            var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
99
            var length = [% Koha.Preference('minPasswordLength') %];
100
            if ( length < 8 ) length = 8;
101
            var password='';
102
            for ( var i = 0 ; i < length ; i++){
103
                password += chars.charAt(Math.floor(Math.random()*chars.length));
104
            }
105
            return password;
106
        }
107
        $(document).ready(function() {
108
            $("body").on('click', "#fillrandom",function(e) {
109
                e.preventDefault();
110
                var password = '';
111
                var pattern_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{[% Koha.Preference('minPasswordLength') %],}/;
112
                while ( ! pattern_regex.test( password ) ) {
113
                    password = generate_password();
114
                }
115
                $("#newpassword").val(password);
116
                $("#newpassword").attr('type', 'text');
117
                $("#newpassword2").val(password);
118
                $("#newpassword2").attr('type', 'text');
119
            });
120
            $("div.hint").eq(0).after(" <div class=\"hint\"><a href=\"#\" id=\"fillrandom\">"+_("Click to fill with a randomly generated suggestion. ")+"<strong>"+_("Passwords will be displayed as text")+"</strong>.</a></div>");
121
122
            $(document).ajaxStart(function () {
123
                $("input[name^=newpassword]").hide();
124
                $("label[for=newpassword2]").hide();
125
                $(".hint:last").after($(".loading").show());
126
            });
127
            $(document).ajaxStop(function () {
128
                $("input[name^=newpassword]").show();
129
                $("label[for=newpassword2]").show();
130
                $(".loading").hide();
131
                $("label.error").hide();
132
            });
133
            [% IF NOMATCH %]
134
                $("#newpassword").addClass('focus');
135
            [% END %]
136
137
            $("#changepasswordf").validate({
138
                rules: {
139
                    newpassword: {
140
                        required: true,
141
                        password_strong: true,
142
                        password_no_spaces: true
143
                    },
144
                    newpassword2: {
145
                        required: true,
146
                        password_match: true
147
                    }
148
                }
149
            });
150
        });
151
    </script>
152
    [% PROCESS 'password_check.inc' %]
153
    [% PROCESS 'add_password_check' new_password => 'newpassword' %]
154
[% END %]
155
149
[% INCLUDE 'intranet-bottom.inc' %]
156
[% INCLUDE 'intranet-bottom.inc' %]
150
[% PROCESS 'password_check.inc' %]
151
[% PROCESS 'add_password_check' new_password => 'newpassword' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (-309 / +314 lines)
Lines 2-321 Link Here
2
[% USE ColumnsSettings %]
2
[% USE ColumnsSettings %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Categories %]
4
[% USE Categories %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Patrons [% IF ( searching ) %]&rsaquo; Search results[% END %]</title>
7
<title>Koha &rsaquo; Patrons [% IF ( searching ) %]&rsaquo; Search results[% END %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'columns_settings.inc' %]
11
<script type="text/javascript">
12
//<![CDATA[
13
$(document).ready(function() {
14
    $('#add_to_patron_list_submit').prop('disabled', true);
15
    $('#new_patron_list').hide();
16
17
    $('#add_to_patron_list').change(function() {
18
        var value = $('#add_to_patron_list').val();
19
        if ( value == 'new' ) {
20
            $('#new_patron_list').val('')
21
            $('#new_patron_list').show();
22
            $('#new_patron_list').focus();
23
        } else if ( value ) {
24
            $('#new_patron_list').hide();
25
            $('#add_to_patron_list_submit').prop('disabled', false);
26
        } else {
27
            $('#new_patron_list').hide();
28
            $('#add_to_patron_list_submit').prop('disabled', true);
29
        }
30
    });
31
32
    $('#new_patron_list').on('input', function() {
33
        if ( $('#new_patron_list').val() ) {
34
            $('#add_to_patron_list_submit').prop('disabled', false);
35
        } else {
36
            $('#add_to_patron_list_submit').prop('disabled', true);
37
        }
38
    });
39
40
    $("#add_to_patron_list_submit").on('click', function(e){
41
        if ( $('#add_to_patron_list').val() == 'new' ) {
42
            if ( $('#new_patron_list').val() ) {
43
                $("#add_to_patron_list option").each(function() {
44
                    if ( $(this).text() == $('#new_patron_list').val() ) {
45
                        alert( _("You already have a list with that name!") );
46
                        return false;
47
                    }
48
                });
49
            } else {
50
                alert( _("You must give your new patron list a name!") );
51
                return false;
52
            }
53
        }
54
55
        if ( $("#memberresultst input:checkbox:checked").length == 0 ) {
56
            alert( _("You have not selected any patrons to add to a list!") );
57
            return false;
58
        }
59
60
        var borrowernumbers = [];
61
        $("#memberresultst").find("input:checkbox:checked").each(function(){
62
            borrowernumbers.push($(this).val());
63
        });
64
        var data = {
65
            add_to_patron_list: $("#add_to_patron_list").val(),
66
            new_patron_list: $("#new_patron_list").val(),
67
            borrowernumbers: borrowernumbers
68
        };
69
        $.ajax({
70
            data: data,
71
            type: 'POST',
72
            url: '/cgi-bin/koha/svc/members/add_to_list',
73
            success: function(data) {
74
                $("#patron_list_dialog").show();
75
                $("#patron_list_dialog > span.patrons-length").html(data.patrons_added_to_list);
76
                $("#patron_list_dialog > a").attr("href", "/cgi-bin/koha/patron_lists/list.pl?patron_list_id=" + data.patron_list.patron_list_id);
77
                $("#patron_list_dialog > a").html(data.patron_list.name);
78
                if ( $('#add_to_patron_list').val() == 'new' ) {
79
                    var new_patron_list_added = $("<option>", {
80
                        value: data.patron_list.patron_list_id,
81
                        text: data.patron_list.name
82
                    });
83
                    $("#add_to_patron_list optgroup").append(new_patron_list_added);
84
                    $("#add_to_patron_list").val(data.patron_list.patron_list_id);
85
                    $("#new_patron_list").val('');
86
                    $('#add_to_patron_list').change();
87
                }
88
            },
89
            error: function() {
90
                alert("an error occurred");
91
            }
92
        });
93
        return true;
94
    });
95
    $(".filterByLetter").on("click",function(e){
96
        e.preventDefault();
97
        filterByFirstLetterSurname($(this).text());
98
    });
99
    $("#select_all").on("click",function(e){
100
        e.preventDefault();
101
        $(".selection").prop("checked", true);
102
    });
103
    $("#clear_all").on("click",function(e){
104
        e.preventDefault();
105
        $(".selection").prop("checked", false);
106
    });
107
    $("#clear_search").on("click",function(e){
108
        e.preventDefault();
109
        clearFilters(true);
110
    });
111
    $("#searchform").on("submit", filter);
112
});
113
114
var dtMemberResults;
115
var search = 1;
116
$(document).ready(function() {
117
    [% IF searchmember %]
118
        $("#searchmember_filter").val("[% searchmember | html %]");
119
    [% END %]
120
    [% IF searchfieldstype %]
121
        $("searchfieldstype_filter").val("[% searchfieldstype %]");
122
    [% END %]
123
    [% IF searchtype %]
124
        $("#searchtype_filter").val("[% searchtype %]");
125
    [% END %]
126
    [% IF categorycode %]
127
        $("#categorycode_filter").val("[% categorycode_filter %]");
128
    [% END %]
129
    [% IF branchcode %]
130
        $("#branchcode_filter").val("[% branchcode_filter %]");
131
    [% END %]
132
133
    [% IF view != "show_results" %]
134
        search = 0;
135
    [% ELSE %]
136
        $("#searchresults").show();
137
    [% END %]
138
139
    // Build the aLengthMenu
140
    var aLengthMenu = [
141
        [%PatronsPerPage %], 10, 20, 50, 100, -1
142
    ];
143
    jQuery.unique(aLengthMenu);
144
    aLengthMenu.sort(function( a, b ){
145
        // Put "All" at the end
146
        if ( a == -1 ) {
147
            return 1;
148
        } else if ( b == -1 ) {
149
            return -1;
150
        }
151
        return parseInt(a) < parseInt(b) ? -1 : 1;}
152
    );
153
    var aLengthMenuLabel = [];
154
    $(aLengthMenu).each(function(){
155
        if ( this == -1 ) {
156
            // Label for -1 is "All"
157
            aLengthMenuLabel.push("All");
158
        } else {
159
            aLengthMenuLabel.push(this);
160
        }
161
    });
162
163
    // Apply DataTables on the results table
164
    var columns_settings = [% ColumnsSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) %];
165
    [% UNLESS CAN_user_tools_manage_patron_lists %]
166
        [%# Remove the first column if we do not display the checkbox %]
167
        columns_settings.splice(0, 1);
168
    [% END %]
169
    dtMemberResults = KohaTable("#memberresultst", {
170
        'bServerSide': true,
171
        'sAjaxSource': "/cgi-bin/koha/svc/members/search",
172
        'fnServerData': function(sSource, aoData, fnCallback) {
173
            if ( ! search ) {
174
                return;
175
            }
176
            aoData.push({
177
                'name': 'searchmember',
178
                'value': $("#searchmember_filter").val()
179
            },{
180
                'name': 'firstletter',
181
                'value': $("#firstletter_filter").val()
182
            },{
183
                'name': 'searchfieldstype',
184
                'value': $("#searchfieldstype_filter").val()
185
            },{
186
                'name': 'searchtype',
187
                'value': $("#searchtype_filter").val()
188
            },{
189
                'name': 'categorycode',
190
                'value': $("#categorycode_filter").val()
191
            },{
192
                'name': 'branchcode',
193
                'value': $("#branchcode_filter").val()
194
            },{
195
                'name': 'name_sorton',
196
                'value': 'borrowers.surname borrowers.firstname'
197
            },{
198
                'name': 'dateofbirth',
199
                'value': 'borrowers.dateofbirth',
200
            },{
201
                'name': 'category_sorton',
202
                'value': 'categories.description',
203
            },{
204
                'name': 'branch_sorton',
205
                'value': 'branches.branchname'
206
            },{
207
                'name': 'template_path',
208
                'value': 'members/tables/members_results.tt',
209
            });
210
            $.ajax({
211
                'dataType': 'json',
212
                'type': 'POST',
213
                'url': sSource,
214
                'data': aoData,
215
                'success': function(json){
216
                    // redirect if there is only 1 result.
217
                    if ( json.aaData.length == 1 ) {
218
                        var borrowernumber = json.aaData[0].borrowernumber;
219
                        document.location.href="/cgi-bin/koha/members/moremember.pl?borrowernumber="+borrowernumber;
220
                        return false;
221
                    }
222
                    fnCallback(json);
223
                }
224
            });
225
        },
226
        'aoColumns':[
227
            [% IF CAN_user_tools_manage_patron_lists %]
228
              { 'mDataProp': 'dt_borrowernumber', 'bSortable': false },
229
            [% END %]
230
            { 'mDataProp': 'dt_cardnumber' },
231
            { 'mDataProp': 'dt_name' },
232
            { 'mDataProp': 'dt_dateofbirth' },
233
            { 'mDataProp': 'dt_category' },
234
            { 'mDataProp': 'dt_branch' },
235
            { 'mDataProp': 'dt_dateexpiry' },
236
            { 'mDataProp': 'dt_od_checkouts', 'bSortable': false },
237
            { 'mDataProp': 'dt_fines', 'bSortable': false },
238
            { 'mDataProp': 'dt_borrowernotes' },
239
            { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
240
        ],
241
        'fnRowCallback': function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
242
            /* Center text for 6th column */
243
            $("td:eq(5)", nRow).css("text-align", "center");
244
245
            return nRow;
246
        },
247
        'bFilter': false,
248
        'bAutoWidth': false,
249
        [% IF CAN_user_tools_manage_patron_lists %]
250
            'aaSorting': [[2, 'asc']],
251
        [% ELSE %]
252
            'aaSorting': [[1, 'asc']],
253
        [% END %]
254
        "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
255
        'sPaginationType': 'full_numbers',
256
        "iDisplayLength": [% PatronsPerPage %],
257
        "bProcessing": true,
258
    }, columns_settings);
259
    update_searched();
260
});
261
262
// Update the string "Results found ..."
263
function update_searched(){
264
    var searched = $("#searchfieldstype_filter").find("option:selected").text();
265
    if ( $("#searchmember_filter").val() ) {
266
        if ( $("#searchtype_filter").val() == 'start_with' ) {
267
            searched += _(" starting with ");
268
        } else {
269
            searched += _(" containing ");
270
        }
271
        searched += "'" + $("#searchmember_filter").val() + "'";
272
    }
273
    if ( $("#firstletter_filter").val() ) {
274
        searched += _(" begins with ") + "'" + $("#firstletter_filter").val() +"'";
275
    }
276
    if ( $("#categorycode_filter").val() ) {
277
        searched += _(" with category ") + "'" + $("#categorycode_filter").find("option:selected").text() + "'";
278
    }
279
    if ( $("#branchcode_filter").val() ) {
280
        searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text();
281
    }
282
    $("#searchpattern").text(searched);
283
}
284
285
// Redraw the table
286
function filter() {
287
    $("#firstletter_filter").val('');
288
    update_searched();
289
    search = 1;
290
    $("#searchresults").show();
291
    dtMemberResults.fnDraw();
292
    return false;
293
}
294
295
// User has clicked on the Clear button
296
function clearFilters(redraw) {
297
    $("#searchform select").val('');
298
    $("#firstletter_filter").val('');
299
    $("#searchmember_filter").val('');
300
    if(redraw) {
301
        search = 1;
302
        $("#searchresults").show();
303
        dtMemberResults.fnDraw();
304
    }
305
}
306
307
// User has clicked on a letter
308
function filterByFirstLetterSurname(letter) {
309
    clearFilters(false);
310
    $("#firstletter_filter").val(letter);
311
    update_searched();
312
    search = 1;
313
    $("#searchresults").show();
314
    dtMemberResults.fnDraw();
315
}
316
//]]>
317
</script>
318
</head>
10
</head>
11
319
<body id="pat_member" class="pat">
12
<body id="pat_member" class="pat">
320
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'header.inc' %]
321
[% INCLUDE 'patron-search.inc' %]
14
[% INCLUDE 'patron-search.inc' %]
Lines 527-530 function filterByFirstLetterSurname(letter) { Link Here
527
    [% INCLUDE 'members-menu.inc' %]
220
    [% INCLUDE 'members-menu.inc' %]
528
  </div>
221
  </div>
529
</div>
222
</div>
223
224
[% MACRO jsinclude BLOCK %]
225
    [% INCLUDE 'datatables.inc' %]
226
    [% INCLUDE 'columns_settings.inc' %]
227
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
228
    <script type="text/javascript">
229
        $(document).ready(function() {
230
            $('#add_to_patron_list_submit').prop('disabled', true);
231
            $('#new_patron_list').hide();
232
233
            $('#add_to_patron_list').change(function() {
234
                var value = $('#add_to_patron_list').val();
235
                if ( value == 'new' ) {
236
                    $('#new_patron_list').val('')
237
                    $('#new_patron_list').show();
238
                    $('#new_patron_list').focus();
239
                } else if ( value ) {
240
                    $('#new_patron_list').hide();
241
                    $('#add_to_patron_list_submit').prop('disabled', false);
242
                } else {
243
                    $('#new_patron_list').hide();
244
                    $('#add_to_patron_list_submit').prop('disabled', true);
245
                }
246
            });
247
248
            $('#new_patron_list').on('input', function() {
249
                if ( $('#new_patron_list').val() ) {
250
                    $('#add_to_patron_list_submit').prop('disabled', false);
251
                } else {
252
                    $('#add_to_patron_list_submit').prop('disabled', true);
253
                }
254
            });
255
256
            $("#add_to_patron_list_submit").on('click', function(e){
257
                if ( $('#add_to_patron_list').val() == 'new' ) {
258
                    if ( $('#new_patron_list').val() ) {
259
                        $("#add_to_patron_list option").each(function() {
260
                            if ( $(this).text() == $('#new_patron_list').val() ) {
261
                                alert( _("You already have a list with that name!") );
262
                                return false;
263
                            }
264
                        });
265
                    } else {
266
                        alert( _("You must give your new patron list a name!") );
267
                        return false;
268
                    }
269
                }
270
271
                if ( $("#memberresultst input:checkbox:checked").length == 0 ) {
272
                    alert( _("You have not selected any patrons to add to a list!") );
273
                    return false;
274
                }
275
276
                var borrowernumbers = [];
277
                $("#memberresultst").find("input:checkbox:checked").each(function(){
278
                    borrowernumbers.push($(this).val());
279
                });
280
                var data = {
281
                    add_to_patron_list: $("#add_to_patron_list").val(),
282
                    new_patron_list: $("#new_patron_list").val(),
283
                    borrowernumbers: borrowernumbers
284
                };
285
                $.ajax({
286
                    data: data,
287
                    type: 'POST',
288
                    url: '/cgi-bin/koha/svc/members/add_to_list',
289
                    success: function(data) {
290
                        $("#patron_list_dialog").show();
291
                        $("#patron_list_dialog > span.patrons-length").html(data.patrons_added_to_list);
292
                        $("#patron_list_dialog > a").attr("href", "/cgi-bin/koha/patron_lists/list.pl?patron_list_id=" + data.patron_list.patron_list_id);
293
                        $("#patron_list_dialog > a").html(data.patron_list.name);
294
                        if ( $('#add_to_patron_list').val() == 'new' ) {
295
                            var new_patron_list_added = $("<option>", {
296
                                value: data.patron_list.patron_list_id,
297
                                text: data.patron_list.name
298
                            });
299
                            $("#add_to_patron_list optgroup").append(new_patron_list_added);
300
                            $("#add_to_patron_list").val(data.patron_list.patron_list_id);
301
                            $("#new_patron_list").val('');
302
                            $('#add_to_patron_list').change();
303
                        }
304
                    },
305
                    error: function() {
306
                        alert("an error occurred");
307
                    }
308
                });
309
                return true;
310
            });
311
            $(".filterByLetter").on("click",function(e){
312
                e.preventDefault();
313
                filterByFirstLetterSurname($(this).text());
314
            });
315
            $("#select_all").on("click",function(e){
316
                e.preventDefault();
317
                $(".selection").prop("checked", true);
318
            });
319
            $("#clear_all").on("click",function(e){
320
                e.preventDefault();
321
                $(".selection").prop("checked", false);
322
            });
323
            $("#clear_search").on("click",function(e){
324
                e.preventDefault();
325
                clearFilters(true);
326
            });
327
            $("#searchform").on("submit", filter);
328
        });
329
330
        var dtMemberResults;
331
        var search = 1;
332
        $(document).ready(function() {
333
            [% IF searchmember %]
334
                $("#searchmember_filter").val("[% searchmember | html %]");
335
            [% END %]
336
            [% IF searchfieldstype %]
337
                $("searchfieldstype_filter").val("[% searchfieldstype %]");
338
            [% END %]
339
            [% IF searchtype %]
340
                $("#searchtype_filter").val("[% searchtype %]");
341
            [% END %]
342
            [% IF categorycode %]
343
                $("#categorycode_filter").val("[% categorycode_filter %]");
344
            [% END %]
345
            [% IF branchcode %]
346
                $("#branchcode_filter").val("[% branchcode_filter %]");
347
            [% END %]
348
349
            [% IF view != "show_results" %]
350
                search = 0;
351
            [% ELSE %]
352
                $("#searchresults").show();
353
            [% END %]
354
355
            // Build the aLengthMenu
356
            var aLengthMenu = [
357
                [%PatronsPerPage %], 10, 20, 50, 100, -1
358
            ];
359
            jQuery.unique(aLengthMenu);
360
            aLengthMenu.sort(function( a, b ){
361
                // Put "All" at the end
362
                if ( a == -1 ) {
363
                    return 1;
364
                } else if ( b == -1 ) {
365
                    return -1;
366
                }
367
                return parseInt(a) < parseInt(b) ? -1 : 1;}
368
            );
369
            var aLengthMenuLabel = [];
370
            $(aLengthMenu).each(function(){
371
                if ( this == -1 ) {
372
                    // Label for -1 is "All"
373
                    aLengthMenuLabel.push("All");
374
                } else {
375
                    aLengthMenuLabel.push(this);
376
                }
377
            });
378
379
            // Apply DataTables on the results table
380
            var columns_settings = [% ColumnsSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) %];
381
            [% UNLESS CAN_user_tools_manage_patron_lists %]
382
                [%# Remove the first column if we do not display the checkbox %]
383
                columns_settings.splice(0, 1);
384
            [% END %]
385
            dtMemberResults = KohaTable("#memberresultst", {
386
                'bServerSide': true,
387
                'sAjaxSource': "/cgi-bin/koha/svc/members/search",
388
                'fnServerData': function(sSource, aoData, fnCallback) {
389
                    if ( ! search ) {
390
                        return;
391
                    }
392
                    aoData.push({
393
                        'name': 'searchmember',
394
                        'value': $("#searchmember_filter").val()
395
                    },{
396
                        'name': 'firstletter',
397
                        'value': $("#firstletter_filter").val()
398
                    },{
399
                        'name': 'searchfieldstype',
400
                        'value': $("#searchfieldstype_filter").val()
401
                    },{
402
                        'name': 'searchtype',
403
                        'value': $("#searchtype_filter").val()
404
                    },{
405
                        'name': 'categorycode',
406
                        'value': $("#categorycode_filter").val()
407
                    },{
408
                        'name': 'branchcode',
409
                        'value': $("#branchcode_filter").val()
410
                    },{
411
                        'name': 'name_sorton',
412
                        'value': 'borrowers.surname borrowers.firstname'
413
                    },{
414
                        'name': 'dateofbirth',
415
                        'value': 'borrowers.dateofbirth',
416
                    },{
417
                        'name': 'category_sorton',
418
                        'value': 'categories.description',
419
                    },{
420
                        'name': 'branch_sorton',
421
                        'value': 'branches.branchname'
422
                    },{
423
                        'name': 'template_path',
424
                        'value': 'members/tables/members_results.tt',
425
                    });
426
                    $.ajax({
427
                        'dataType': 'json',
428
                        'type': 'POST',
429
                        'url': sSource,
430
                        'data': aoData,
431
                        'success': function(json){
432
                            // redirect if there is only 1 result.
433
                            if ( json.aaData.length == 1 ) {
434
                                var borrowernumber = json.aaData[0].borrowernumber;
435
                                document.location.href="/cgi-bin/koha/members/moremember.pl?borrowernumber="+borrowernumber;
436
                                return false;
437
                            }
438
                            fnCallback(json);
439
                        }
440
                    });
441
                },
442
                'aoColumns':[
443
                    [% IF CAN_user_tools_manage_patron_lists %]
444
                      { 'mDataProp': 'dt_borrowernumber', 'bSortable': false },
445
                    [% END %]
446
                    { 'mDataProp': 'dt_cardnumber' },
447
                    { 'mDataProp': 'dt_name' },
448
                    { 'mDataProp': 'dt_dateofbirth' },
449
                    { 'mDataProp': 'dt_category' },
450
                    { 'mDataProp': 'dt_branch' },
451
                    { 'mDataProp': 'dt_dateexpiry' },
452
                    { 'mDataProp': 'dt_od_checkouts', 'bSortable': false },
453
                    { 'mDataProp': 'dt_fines', 'bSortable': false },
454
                    { 'mDataProp': 'dt_borrowernotes' },
455
                    { 'mDataProp': 'dt_action', 'bSortable': false, 'sClass': 'actions' }
456
                ],
457
                'fnRowCallback': function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
458
                    /* Center text for 6th column */
459
                    $("td:eq(5)", nRow).css("text-align", "center");
460
461
                    return nRow;
462
                },
463
                'bFilter': false,
464
                'bAutoWidth': false,
465
                [% IF CAN_user_tools_manage_patron_lists %]
466
                    'aaSorting': [[2, 'asc']],
467
                [% ELSE %]
468
                    'aaSorting': [[1, 'asc']],
469
                [% END %]
470
                "aLengthMenu": [aLengthMenu, aLengthMenuLabel],
471
                'sPaginationType': 'full_numbers',
472
                "iDisplayLength": [% PatronsPerPage %],
473
                "bProcessing": true,
474
            }, columns_settings);
475
            update_searched();
476
        });
477
478
        // Update the string "Results found ..."
479
        function update_searched(){
480
            var searched = $("#searchfieldstype_filter").find("option:selected").text();
481
            if ( $("#searchmember_filter").val() ) {
482
                if ( $("#searchtype_filter").val() == 'start_with' ) {
483
                    searched += _(" starting with ");
484
                } else {
485
                    searched += _(" containing ");
486
                }
487
                searched += "'" + $("#searchmember_filter").val() + "'";
488
            }
489
            if ( $("#firstletter_filter").val() ) {
490
                searched += _(" begins with ") + "'" + $("#firstletter_filter").val() +"'";
491
            }
492
            if ( $("#categorycode_filter").val() ) {
493
                searched += _(" with category ") + "'" + $("#categorycode_filter").find("option:selected").text() + "'";
494
            }
495
            if ( $("#branchcode_filter").val() ) {
496
                searched += _(" in library ") + $("#branchcode_filter").find("option:selected").text();
497
            }
498
            $("#searchpattern").text(searched);
499
        }
500
501
        // Redraw the table
502
        function filter() {
503
            $("#firstletter_filter").val('');
504
            update_searched();
505
            search = 1;
506
            $("#searchresults").show();
507
            dtMemberResults.fnDraw();
508
            return false;
509
        }
510
511
        // User has clicked on the Clear button
512
        function clearFilters(redraw) {
513
            $("#searchform select").val('');
514
            $("#firstletter_filter").val('');
515
            $("#searchmember_filter").val('');
516
            if(redraw) {
517
                search = 1;
518
                $("#searchresults").show();
519
                dtMemberResults.fnDraw();
520
            }
521
        }
522
523
        // User has clicked on a letter
524
        function filterByFirstLetterSurname(letter) {
525
            clearFilters(false);
526
            $("#firstletter_filter").val(letter);
527
            update_searched();
528
            search = 1;
529
            $("#searchresults").show();
530
            dtMemberResults.fnDraw();
531
        }
532
    </script>
533
[% END %]
534
530
[% INCLUDE 'intranet-bottom.inc' %]
535
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-204 / +214 lines)
Lines 1-152 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
6
<title>Koha &rsaquo; Patrons &rsaquo; [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %])</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
8
[% INCLUDE 'calendar.inc' %]
9
<script type="text/javascript">
10
//<![CDATA[
11
$(document).ready(function() {
12
13
        $("#saverecord").css({ 'margin-left': 0 });
14
        var original_offset = $("#toolbar").position().top;
15
        var additional_height = $("#filters").height();
16
        $('#toolbar').fixFloat({ 'originalOffset': original_offset });
17
        $("#filteraction_on").on("click", function(){
18
            $(window).off('scroll');
19
            $("#toolbar").css({ top: original_offset + additional_height });
20
            $('#toolbar').fixFloat({ 'originalOffset': original_offset + additional_height });
21
        });
22
        $("#filteraction_off").on("click", function(){
23
            $(window).off('scroll');
24
            $("#toolbar").css({ top: original_offset });
25
            $('#toolbar').fixFloat({ 'originalOffset': original_offset });
26
        })
27
28
	[% IF categorycode %]
29
		update_category_code( "[% categorycode %]" );
30
	[% ELSE %]
31
		if ( $("#categorycode_entry").length > 0 ){
32
			var category_code = $("#categorycode_entry").find("option:selected").val();
33
			update_category_code( category_code );
34
		}
35
	[% END %]
36
});
37
38
function update_cardnumber_warning(size){
39
    var max_len = [% maxlength_cardnumber %];
40
    if ( size >= max_len ) {
41
        $("#cn_max").show();
42
    } else {
43
        $("#cn_max").hide();
44
    }
45
}
46
47
$(document).ready(function() {
48
    $("#cn_max").hide();
49
    var content;
50
    $("#cardnumber").on("keydown", function(e){
51
        content = $(this).val();
52
    });
53
    $("#cardnumber").on("keyup", function(e){
54
        // .val() will return the value of the input after the key has been released
55
        var l = $(this).val().length;
56
        if ( l == content.length + 1 ) { l--; }
57
        update_cardnumber_warning(l);
58
    });
59
    $("#cardnumber").bind("paste", function(e){
60
        var pastedData = e.originalEvent.clipboardData.getData('text');
61
        update_cardnumber_warning(pastedData.length - 1);
62
    } );
63
    var toggle_quick_add = $(".toggle_quick_add");
64
    $(toggle_quick_add).click(function(e){
65
        toggle_quick_add.toggle();
66
        e.preventDefault();
67
        var toggle_to = '';
68
        var toggle_from = '';
69
        if( $("#entryform:visible").length ) {
70
            toggle_to = "#quick_add_form label";
71
            toggle_from = "#entryform label";
72
        } else {
73
            toggle_to="#entryform label";
74
            toggle_from = "#quick_add_form label";
75
        }
76
        $(toggle_from).each(function() {
77
            var input_label = $(this).attr('for');
78
            if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
79
                $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
80
                return;
81
            }
82
            $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
83
        });
84
85
        $(".toggler").toggle();
86
    });
87
88
    $("#save_quick_add").click(function(){
89
        $("#quick_add_form").validate();
90
        if( $("#quick_add_form").valid()){
91
            $('.toggle_quick_add').click();
92
            $('#saverecord').click();
93
        }
94
        else {return false;}
95
    });
96
97
    $("#entryform").validate({
98
        rules: {
99
            password: {
100
                required: true,
101
                password_strong: true,
102
                password_no_spaces: true
103
            },
104
            password2: {
105
                required: true,
106
                password_match: true
107
            }
108
        }
109
    });
110
111
    $("#saverecord").click(function(){
112
        if( check_form_borrowers() ){
113
            $("#entryform").submit();
114
        }
115
    });
116
117
    $('#duplicate').on('click', function() {
118
        $("input[name='op']").val('modify');
119
        $("input[name='borrowernumber']").val('[% check_member %]');
120
        $("input[name='check_member']").val('');
121
        $('#entryform').submit();
122
    });
123
124
    $('#not-duplicate').on('click', function() {
125
        $("input[name='nodouble']").val('1');
126
        $('#entryform').submit();
127
    });
128
});
129
130
        var MSG_SEPARATOR = _("Separator must be / in field %s");
131
        var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
132
        var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
133
        var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
134
        var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
135
        var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
136
        var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
137
        var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
138
        var MSG_MONTH = _("%s month")
139
        var MSG_MONTHS = _("%s months")
140
        var MSG_YEAR = _("%s year")
141
        var MSG_YEARS = _("%s years")
142
        var LABEL_CHANGE = _("Change");
143
        var LABEL_SET_TO_PATRON = _("Set to patron");
144
        var LABEL_AGE = _("Age");
145
146
//]]>
147
</script>
148
<script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script>
149
</head>
8
</head>
9
150
<body id="pat_memberentrygen" class="pat">
10
<body id="pat_memberentrygen" class="pat">
151
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
152
[% INCLUDE 'patron-search.inc' %]
12
[% INCLUDE 'patron-search.inc' %]
Lines 1189-1194 $(document).ready(function() { Link Here
1189
[% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1049
[% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %]
1190
  <fieldset class="rows" id="memberentry_messaging_prefs">
1050
  <fieldset class="rows" id="memberentry_messaging_prefs">
1191
    <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1051
    <legend id="patron_messaging_prefs_lgd">Patron messaging preferences</legend>
1052
    <input type="hidden" name="setting_messaging_prefs" value="1" />
1053
    [% INCLUDE 'messaging-preference-form.inc' %]
1054
    [% IF ( SMSSendDriver ) %]
1055
        <p><label for="SMSnumber">SMS number:</label>
1056
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1057
        </p>
1058
        <p>
1059
            <label for="sms_provider_id">SMS provider:</label>
1060
            <select id="sms_provider_id" name="sms_provider_id"/>
1061
                <option value="">Unknown</option>
1062
                [% FOREACH s IN sms_providers %]
1063
                    [% IF s.id == sms_provider_id %]
1064
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1065
                    [% ELSE %]
1066
                        <option value="[% s.id %]">[% s.name %]</option>
1067
                    [% END %]
1068
                [% END %]
1069
            </select>
1070
        </p>
1071
    [% END %]
1072
  </fieldset>
1073
[% END %] [% END %]
1074
1075
</form>
1076
1077
[% IF quickadd && opadd  && !check_member %]
1078
    <form id="quick_add_form" class="toggler">
1079
        <fieldset class="rows quick_add"><legend>Quick add</legend>
1080
            <ol id="quick_add_list">
1081
            </ol>
1082
        </fieldset>
1083
    </form>
1084
[% END %]
1085
</div>
1086
</div>
1087
1088
[% UNLESS ( opadd ) %]<div class="yui-b">
1089
[% INCLUDE 'members-menu.inc' %]
1090
</div>[% END %]
1091
[% END %]
1092
</div>
1093
1094
[% MACRO jsinclude BLOCK %]
1095
1192
    [% IF ( opadd ) %]
1096
    [% IF ( opadd ) %]
1193
    <!-- handle changing prefs if creating new patron and changing
1097
    <!-- handle changing prefs if creating new patron and changing
1194
         the patron category
1098
         the patron category
Lines 1235-1313 $(document).ready(function() { Link Here
1235
    //]]>
1139
    //]]>
1236
    </script>
1140
    </script>
1237
    [% END %]
1141
    [% END %]
1238
    <input type="hidden" name="setting_messaging_prefs" value="1" />
1142
1239
    [% INCLUDE 'messaging-preference-form.inc' %]
1143
    [% IF quickadd && opadd  && !check_member %]
1240
    [% IF ( SMSSendDriver ) %]
1144
        <script type="text/javascript">
1241
        <p><label for="SMSnumber">SMS number:</label>
1145
            $(document).ready(function () {
1242
            <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber %]" />
1146
1243
        </p>
1147
                $("#entryform,#saverecord").hide();
1244
        <p>
1148
                [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1245
            <label for="sms_provider_id">SMS provider:</label>
1149
                var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field %]",[% END %]];
1246
            <select id="sms_provider_id" name="sms_provider_id"/>
1150
                var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1247
                <option value="">Unknown</option>
1151
                $("#entryform label").each(function () {
1248
                [% FOREACH s IN sms_providers %]
1152
                    var input_label = $(this).attr('for');
1249
                    [% IF s.id == sms_provider_id %]
1153
                    if ( input_label == 'sex-female' ) {
1250
                        <option value="[% s.id %]" selected="selected">[% s.name %]</option>
1154
                        input_label='sex';
1251
                    [% ELSE %]
1155
                    }
1252
                        <option value="[% s.id %]">[% s.name %]</option>
1156
                    else if ( input_label == 'btitle' ) {
1253
                    [% END %]
1157
                        input_label='title';
1254
                [% END %]
1158
                    }
1255
            </select>
1159
                    if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1256
        </p>
1160
                    if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1161
                       $(this).parent().clone().appendTo("#quick_add_list");
1162
                       [% UNLESS mandatorypassword %]
1163
                             if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1164
                       [% END %]
1165
                    }
1166
                });
1167
                    if( $("#memberentry_guarantor").length ) {
1168
                        $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1169
                        $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
1170
                        $("#quick_add_list #guarantordelete").prop('id','qagd');
1171
                    }
1172
                $("#qagd").click(function() { $("#guarantordelete").click(); });
1173
                $("#quick_add_form").show();
1174
            });
1175
        </script>
1257
    [% END %]
1176
    [% END %]
1258
  </fieldset>
1259
[% END %] [% END %]
1260
1177
1261
</form>
1178
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
1179
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
1180
    [% INCLUDE 'calendar.inc' %]
1181
    <script type="text/javascript">
1182
        $(document).ready(function() {
1183
            $("#saverecord").css({ 'margin-left': 0 });
1184
            var original_offset = $("#toolbar").position().top;
1185
            var additional_height = $("#filters").height();
1186
            $('#toolbar').fixFloat({ 'originalOffset': original_offset });
1187
            $("#filteraction_on").on("click", function(){
1188
                $(window).off('scroll');
1189
                $("#toolbar").css({ top: original_offset + additional_height });
1190
                $('#toolbar').fixFloat({ 'originalOffset': original_offset + additional_height });
1191
            });
1192
            $("#filteraction_off").on("click", function(){
1193
                $(window).off('scroll');
1194
                $("#toolbar").css({ top: original_offset });
1195
                $('#toolbar').fixFloat({ 'originalOffset': original_offset });
1196
            })
1262
1197
1263
[% IF quickadd && opadd  && !check_member %]
1198
            [% IF categorycode %]
1264
    <form id="quick_add_form" class="toggler">
1199
                update_category_code( "[% categorycode %]" );
1265
        <fieldset class="rows quick_add"><legend>Quick add</legend>
1200
            [% ELSE %]
1266
            <ol id="quick_add_list">
1201
                if ( $("#categorycode_entry").length > 0 ){
1267
            </ol>
1202
                    var category_code = $("#categorycode_entry").find("option:selected").val();
1268
        </fieldset>
1203
                    update_category_code( category_code );
1269
    </form>
1204
                }
1270
    <script>
1205
            [% END %]
1271
        $(document).ready(function () {
1206
        });
1272
1207
1273
            $("#entryform,#saverecord").hide();
1208
        function update_cardnumber_warning(size){
1274
            [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1209
            var max_len = [% maxlength_cardnumber %];
1275
            var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field %]",[% END %]];
1210
            if ( size >= max_len ) {
1276
            var skipped_fields = ["contactname","contactfirstname","relationship"]; //Guarantor form is pulled as a whole, ignore individual fields
1211
                $("#cn_max").show();
1277
            $("#entryform label").each(function () {
1212
            } else {
1278
                var input_label = $(this).attr('for');
1213
                $("#cn_max").hide();
1279
                if ( input_label == 'sex-female' ) {
1214
            }
1280
                    input_label='sex';
1215
        }
1216
1217
        $(document).ready(function() {
1218
            $("#cn_max").hide();
1219
            var content;
1220
            $("#cardnumber").on("keydown", function(e){
1221
                content = $(this).val();
1222
            });
1223
            $("#cardnumber").on("keyup", function(e){
1224
                // .val() will return the value of the input after the key has been released
1225
                var l = $(this).val().length;
1226
                if ( l == content.length + 1 ) { l--; }
1227
                update_cardnumber_warning(l);
1228
            });
1229
            $("#cardnumber").bind("paste", function(e){
1230
                var pastedData = e.originalEvent.clipboardData.getData('text');
1231
                update_cardnumber_warning(pastedData.length - 1);
1232
            } );
1233
            var toggle_quick_add = $(".toggle_quick_add");
1234
            $(toggle_quick_add).click(function(e){
1235
                toggle_quick_add.toggle();
1236
                e.preventDefault();
1237
                var toggle_to = '';
1238
                var toggle_from = '';
1239
                if( $("#entryform:visible").length ) {
1240
                    toggle_to = "#quick_add_form label";
1241
                    toggle_from = "#entryform label";
1242
                } else {
1243
                    toggle_to="#entryform label";
1244
                    toggle_from = "#quick_add_form label";
1281
                }
1245
                }
1282
                else if ( input_label == 'btitle' ) {
1246
                $(toggle_from).each(function() {
1283
                    input_label='title';
1247
                    var input_label = $(this).attr('for');
1248
                    if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) {
1249
                        $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1250
                        return;
1251
                    }
1252
                    $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1253
                });
1254
1255
                $(".toggler").toggle();
1256
            });
1257
1258
            $("#save_quick_add").click(function(){
1259
                $("#quick_add_form").validate();
1260
                if( $("#quick_add_form").valid()){
1261
                    $('.toggle_quick_add').click();
1262
                    $('#saverecord').click();
1284
                }
1263
                }
1285
                if ( skipped_fields.indexOf( input_label ) != -1 ) { input_label=""; }
1264
                else {return false;}
1286
                if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1265
            });
1287
                   $(this).parent().clone().appendTo("#quick_add_list");
1266
1288
                   [% UNLESS mandatorypassword %]
1267
            $("#entryform").validate({
1289
                         if( input_label == 'password' ) $("#entryform label[for='password2']").parent().clone().appendTo("#quick_add_list");
1268
                rules: {
1290
                   [% END %]
1269
                    password: {
1270
                        required: true,
1271
                        password_strong: true,
1272
                        password_no_spaces: true
1273
                    },
1274
                    password2: {
1275
                        required: true,
1276
                        password_match: true
1277
                    }
1291
                }
1278
                }
1292
            });
1279
            });
1293
                if( $("#memberentry_guarantor").length ) {
1280
1294
                    $("#memberentry_guarantor").clone().appendTo("#quick_add_list").css("margin",0);
1281
            $("#saverecord").click(function(){
1295
                    $("#quick_add_form #memberentry_guarantor").append("<p>" + _("Note: Quick add guarantor form populates address fields in full form") + "</p>");
1282
                if( check_form_borrowers() ){
1296
                    $("#quick_add_list #guarantordelete").prop('id','qagd');
1283
                    $("#entryform").submit();
1297
                }
1284
                }
1298
            $("#qagd").click(function() { $("#guarantordelete").click(); });
1285
            });
1299
            $("#quick_add_form").show();
1286
1287
            $('#duplicate').on('click', function() {
1288
                $("input[name='op']").val('modify');
1289
                $("input[name='borrowernumber']").val('[% check_member %]');
1290
                $("input[name='check_member']").val('');
1291
                $('#entryform').submit();
1292
            });
1293
1294
            $('#not-duplicate').on('click', function() {
1295
                $("input[name='nodouble']").val('1');
1296
                $('#entryform').submit();
1297
            });
1300
        });
1298
        });
1299
1300
        var MSG_SEPARATOR = _("Separator must be / in field %s");
1301
        var MSG_INCORRECT_DAY = _("Invalid day entered in field %s");
1302
        var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s");
1303
        var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s");
1304
        var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron");
1305
        var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization");
1306
        var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date");
1307
        var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron");
1308
        var MSG_MONTH = _("%s month")
1309
        var MSG_MONTHS = _("%s months")
1310
        var MSG_YEAR = _("%s year")
1311
        var MSG_YEARS = _("%s years")
1312
        var LABEL_CHANGE = _("Change");
1313
        var LABEL_SET_TO_PATRON = _("Set to patron");
1314
        var LABEL_AGE = _("Age");
1315
1301
    </script>
1316
    </script>
1317
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members.js"></script>
1318
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/messaging-preference-form.js"></script>
1319
    [% PROCESS 'password_check.inc' %]
1320
    [% PROCESS 'add_password_check' new_password => 'password' %]
1302
[% END %]
1321
[% END %]
1303
</div>
1304
</div>
1305
1322
1306
[% UNLESS ( opadd ) %]<div class="yui-b">
1307
[% INCLUDE 'members-menu.inc' %]
1308
</div>[% END %]
1309
[% END %]
1310
</div>
1311
[% INCLUDE 'intranet-bottom.inc' %]
1323
[% INCLUDE 'intranet-bottom.inc' %]
1312
[% PROCESS 'password_check.inc' %]
1313
[% PROCESS 'add_password_check' new_password => 'password' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (-5 / +12 lines)
Lines 2-16 Link Here
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE Categories %]
3
[% USE Categories %]
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Patrons &rsaquo; Update patron records</title>
7
<title>Koha &rsaquo; Patrons &rsaquo; Update patron records</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<script type="text/javascript">
9
    $(function() {
10
        $( "#pending_updates" ).accordion();
11
    });
12
</script>
13
</head>
9
</head>
10
14
<body id="pat_update" class="pat">
11
<body id="pat_update" class="pat">
15
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
16
[% INCLUDE 'patron-search.inc' %]
13
[% INCLUDE 'patron-search.inc' %]
Lines 188-191 Link Here
188
185
189
        </div>
186
        </div>
190
    </div>
187
    </div>
188
189
[% MACRO jsinclude BLOCK %]
190
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
191
    <script type="text/javascript">
192
        $(function() {
193
            $( "#pending_updates" ).accordion();
194
        });
195
    </script>
196
[% END %]
197
191
[% INCLUDE 'intranet-bottom.inc' %]
198
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt (+2 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Check duplicate patron</title>
5
<title>Koha &rsaquo; Check duplicate patron</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
Lines 78-81 Link Here
78
	</div>
79
	</div>
79
</div>
80
</div>
80
</div>
81
</div>
82
81
[% INCLUDE 'popup-bottom.inc' %]
83
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt (-1 / +6 lines)
Lines 2-12 Link Here
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE Price %]
4
[% USE Price %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
    <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
7
    <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
7
    [% INCLUDE 'doc-head-close.inc' %]
8
    [% INCLUDE 'doc-head-close.inc' %]
8
    [% INCLUDE 'slip-print.inc' #printThenClose %]
9
</head>
9
</head>
10
10
<body id="pat_moremember-print" class="pat">
11
<body id="pat_moremember-print" class="pat">
11
    <div id="main">
12
    <div id="main">
12
        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
13
        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
Lines 124-127 Link Here
124
        </table>
125
        </table>
125
    [% END %]
126
    [% END %]
126
127
128
[% MACRO jsinclude BLOCK %]
129
    [% INCLUDE 'slip-print.inc' #printThenClose %]
130
[% END %]
131
127
[% INCLUDE 'intranet-bottom.inc' %]
132
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt (-3 / +6 lines)
Lines 1-13 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Print Receipt for [% cardnumber %]</title>
4
<title>Print Receipt for [% cardnumber %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/print.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/print.css" />
8
9
[% INCLUDE 'slip-print.inc' #printThenClose %]
10
</head>
9
</head>
10
11
<body id="pat_moremember-receipt" class="pat">
11
<body id="pat_moremember-receipt" class="pat">
12
12
13
<div id="receipt">
13
<div id="receipt">
Lines 69-73 Date due: [% issueloo.date_due %]</p> Link Here
69
            [% END %]
69
            [% END %]
70
[% END %]
70
[% END %]
71
71
72
[% MACRO jsinclude BLOCK %]
73
    [% INCLUDE 'slip-print.inc' #printThenClose %]
74
[% END %]
72
75
73
[% INCLUDE 'intranet-bottom.inc' %]
76
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-122 / +127 lines)
Lines 3-8 Link Here
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[% USE ColumnsSettings %]
5
[% USE ColumnsSettings %]
6
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Patrons &rsaquo;
8
<title>Koha &rsaquo; Patrons &rsaquo;
8
[% IF ( unknowuser ) %]
9
[% IF ( unknowuser ) %]
Lines 12-141 Link Here
12
[% END %]
13
[% END %]
13
</title>
14
</title>
14
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'calendar.inc' %]
16
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
16
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
17
[% INCLUDE 'datatables.inc' %]
18
[% INCLUDE 'columns_settings.inc' %]
19
[% INCLUDE 'strings.inc' %]
20
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
22
[% INCLUDE 'timepicker.inc' %]
23
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
24
<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation.js"></script>
25
<script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts.js"></script>
26
<script type="text/javascript" src="[% interface %]/[% theme %]/js/holds.js"></script>
27
<script type="text/JavaScript">
28
//<![CDATA[
29
/* Set some variable needed in circulation.js */
30
var interface = "[% interface %]";
31
var theme = "[% theme %]";
32
var borrowernumber = "[% borrowernumber %]";
33
var branchcode = "[% Branches.GetLoggedInBranchcode() %]";
34
var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
35
var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]
36
var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %];
37
var script = "moremember";
38
var relatives_borrowernumbers = new Array();
39
[% FOREACH b IN relatives_borrowernumbers %]
40
    relatives_borrowernumbers.push("[% b %]");
41
[% END %]
42
43
var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
44
45
columns_settings = [% ColumnsSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) %]
46
47
$(document).ready(function() {
48
    if ( $('#clubs-tab').length ) {
49
        $('#clubs-tab-link').on('click', function() {
50
            $('#clubs-tab').text(_("Loading..."));
51
            $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]');
52
        });
53
    }
54
55
    $('#finesholdsissues').tabs({
56
        // Correct table sizing for tables hidden in tabs
57
        // http://www.datatables.net/examples/api/tabs_and_scrolling.html
58
        "show": function(event, ui) {
59
            var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
60
            if ( oTable.length > 0 ) {
61
                oTable.fnAdjustColumnSizing();
62
            }
63
        },
64
        "activate": function( event, ui ) {
65
            $('#'+ui.newTab.context.id).click();
66
        }
67
    } );
68
    $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
69
        "sDom": 't',
70
        "aoColumnDefs": [
71
            { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false }
72
        ],
73
        "aoColumns": [
74
            { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null,null
75
        ],
76
        "bPaginate": false
77
    }));
78
    [% IF ( picture ) %]
79
    // new YAHOO.widget.Button("delpicture");   // FIXME: formatting mismatch between YUI and normal button
80
	$('#delpicture').click(function(){
81
		 return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
82
	});
83
	$('#manage-patron-image').find("input[value*=Upload]").click(function(){
84
        if($("#uploadfile").val() == ""){
85
            alert(_("Please choose a file to upload"));
86
            return false;
87
        }
88
        return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
89
	});[% END %]
90
91
    $("#suspend_until").datepicker({
92
        onClose: function(dateText, inst) {
93
            validate_date(dateText, inst);
94
        },
95
        minDate: 1, // require that hold suspended until date is after today
96
    }).on("change", function(e, value) {
97
        if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
98
    });
99
100
    $("#view_restrictions").on("click",function(){
101
        $('#debarments-tab-link').click();
102
    });
103
 });
104
function uncheck_sibling(me){
105
nodename=me.getAttribute("name");
106
if (nodename =="barcodes[]"){
107
    var Node=me.parentNode.previousSibling;
108
    while (Node.nodeName!="TD"){Node=Node.previousSibling}
109
    var Nodes=Node.childNodes;
110
    for (var i=0;i < Nodes.length;i++){
111
      if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
112
        Nodes[i].checked=false;
113
      }     
114
   }   
115
116
}else {
117
    var Node=me.parentNode.nextSibling;
118
    while (Node.nodeName!="TD"){Node=Node.nextSibling}
119
    var Nodes=Node.childNodes;
120
    for (var i=0;i<Nodes.length;i++){
121
      if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
122
        Nodes[i].checked=false;
123
      }     
124
   }   
125
}
126
}
127
function validate1(date) {
128
    var today = new Date();
129
    if ( date < today ) {
130
        return true;
131
     } else {
132
        return false;
133
     }
134
};
135
//]]>
136
</script>
137
138
</head>
17
</head>
18
139
<body id="pat_moremember" class="pat">
19
<body id="pat_moremember" class="pat">
140
[% INCLUDE 'header.inc' %]
20
[% INCLUDE 'header.inc' %]
141
[% INCLUDE 'patron-search.inc' %]
21
[% INCLUDE 'patron-search.inc' %]
Lines 642-645 function validate1(date) { Link Here
642
[% INCLUDE 'circ-menu.inc' %]
522
[% INCLUDE 'circ-menu.inc' %]
643
</div>
523
</div>
644
</div>
524
</div>
525
526
[% MACRO jsinclude BLOCK %]
527
    [% INCLUDE 'datatables.inc' %]
528
    [% INCLUDE 'columns_settings.inc' %]
529
    [% INCLUDE 'strings.inc' %]
530
    [% INCLUDE 'calendar.inc' %]
531
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
532
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
533
    [% INCLUDE 'timepicker.inc' %]
534
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
535
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation.js"></script>
536
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts.js"></script>
537
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds.js"></script>
538
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
539
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/messaging-preference-form.js"></script>
540
    <script type="text/javascript">
541
        /* Set some variable needed in circulation.js */
542
        var interface = "[% interface %]";
543
        var theme = "[% theme %]";
544
        var borrowernumber = "[% borrowernumber %]";
545
        var branchcode = "[% Branches.GetLoggedInBranchcode() %]";
546
        var exports_enabled = "[% Koha.Preference('ExportCircHistory') %]";
547
        var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]
548
        var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %];
549
        var script = "moremember";
550
        var relatives_borrowernumbers = new Array();
551
        [% FOREACH b IN relatives_borrowernumbers %]
552
            relatives_borrowernumbers.push("[% b %]");
553
        [% END %]
554
555
        var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
556
557
        columns_settings = [% ColumnsSettings.GetColumns( 'members', 'moremember', 'issues-table', 'json' ) %]
558
559
        $(document).ready(function() {
560
            if ( $('#clubs-tab').length ) {
561
                $('#clubs-tab-link').on('click', function() {
562
                    $('#clubs-tab').text(_("Loading..."));
563
                    $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% borrowernumber %]');
564
                });
565
            }
566
567
            $('#finesholdsissues').tabs({
568
                // Correct table sizing for tables hidden in tabs
569
                // http://www.datatables.net/examples/api/tabs_and_scrolling.html
570
                "show": function(event, ui) {
571
                    var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
572
                    if ( oTable.length > 0 ) {
573
                        oTable.fnAdjustColumnSizing();
574
                    }
575
                },
576
                "activate": function( event, ui ) {
577
                    $('#'+ui.newTab.context.id).click();
578
                }
579
            } );
580
            $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
581
                "sDom": 't',
582
                "aoColumnDefs": [
583
                    { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false }
584
                ],
585
                "aoColumns": [
586
                    { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null,null
587
                ],
588
                "bPaginate": false
589
            }));
590
            [% IF ( picture ) %]
591
                $('#delpicture').click(function(){
592
                     return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
593
                });
594
                $('#manage-patron-image').find("input[value*=Upload]").click(function(){
595
                    if($("#uploadfile").val() == ""){
596
                        alert(_("Please choose a file to upload"));
597
                        return false;
598
                    }
599
                    return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
600
                });
601
            [% END %]
602
603
            $("#suspend_until").datepicker({
604
                onClose: function(dateText, inst) {
605
                    validate_date(dateText, inst);
606
                },
607
                minDate: 1, // require that hold suspended until date is after today
608
            }).on("change", function(e, value) {
609
                if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
610
            });
611
612
            $("#view_restrictions").on("click",function(){
613
                $('#debarments-tab-link').click();
614
            });
615
         });
616
        function uncheck_sibling(me){
617
            nodename=me.getAttribute("name");
618
            if (nodename =="barcodes[]"){
619
                var Node=me.parentNode.previousSibling;
620
                while (Node.nodeName!="TD"){Node=Node.previousSibling}
621
                var Nodes=Node.childNodes;
622
                for (var i=0;i < Nodes.length;i++){
623
                    if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
624
                        Nodes[i].checked=false;
625
                    }
626
                }
627
            } else {
628
                var Node=me.parentNode.nextSibling;
629
                while (Node.nodeName!="TD"){Node=Node.nextSibling}
630
                var Nodes=Node.childNodes;
631
                for (var i=0;i<Nodes.length;i++){
632
                    if (Nodes[i].nodeName=="INPUT" && Nodes[i].getAttribute("type")=="checkbox"){
633
                      Nodes[i].checked=false;
634
                    }
635
               }
636
            }
637
        }
638
639
        function validate1(date) {
640
            var today = new Date();
641
            if ( date < today ) {
642
                return true;
643
            } else {
644
                return false;
645
            }
646
        };
647
    </script>
648
[% END %]
649
645
[% INCLUDE 'intranet-bottom.inc' %]
650
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/nl-search.tt (+6 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Search the Norwegian national patron database</title>
4
<title>Search the Norwegian national patron database</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 74-79 Link Here
74
            [% INCLUDE 'circ-menu.inc' %]
75
            [% INCLUDE 'circ-menu.inc' %]
75
        </div>
76
        </div>
76
    </div>
77
    </div>
78
79
[% MACRO jsinclude BLOCK %]
80
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
81
[% END %]
82
77
[% INCLUDE 'intranet-bottom.inc' %]
83
[% INCLUDE 'intranet-bottom.inc' %]
78
84
79
[% BLOCK patron_detail %]
85
[% BLOCK patron_detail %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-20 / +24 lines)
Lines 2-36 Link Here
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
7
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
11
//<![CDATA[
12
    $(document).ready(function() {
13
    $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
14
        "aaSorting": [[ 3, "desc" ]],
15
        "aoColumns": [ null,null,null,{ "sType": "title-string" } ],
16
        "sPaginationType": "four_button"
17
    }));
18
19
        $("#noticestable").on("click", ".notice-title", function(e){
20
            e.preventDefault();
21
            var rowid = $(this).data("noticeid");
22
            $("#notice"+rowid).toggle();
23
            $("#resend_notice"+rowid).toggle();
24
        });
25
26
    });
27
//]]>
28
</script>
29
<style type="text/css">
10
<style type="text/css">
30
    .notice { display: none; }
11
    .notice { display: none; }
31
    .notice-title { font-weight: bold; display: block; }
12
    .notice-title { font-weight: bold; display: block; }
32
</style>
13
</style>
33
</head>
14
</head>
15
34
<body id="pat_notices" class="pat">
16
<body id="pat_notices" class="pat">
35
[% INCLUDE 'header.inc' %]
17
[% INCLUDE 'header.inc' %]
36
[% INCLUDE 'patron-search.inc' %]
18
[% INCLUDE 'patron-search.inc' %]
Lines 105-108 Link Here
105
[% INCLUDE 'circ-menu.inc' %]
87
[% INCLUDE 'circ-menu.inc' %]
106
</div>
88
</div>
107
</div>
89
</div>
90
91
[% MACRO jsinclude BLOCK %]
92
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
93
    [% INCLUDE 'datatables.inc' %]
94
    <script type="text/javascript">
95
        $(document).ready(function() {
96
            $("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
97
                "aaSorting": [[ 3, "desc" ]],
98
                "aoColumns": [ null,null,null,{ "sType": "title-string" } ],
99
                "sPaginationType": "four_button"
100
            }));
101
102
            $("#noticestable").on("click", ".notice-title", function(e){
103
                e.preventDefault();
104
                var rowid = $(this).data("noticeid");
105
                $("#notice"+rowid).toggle();
106
                $("#resend_notice"+rowid).toggle();
107
            });
108
        });
109
    </script>
110
[% END %]
111
108
[% INCLUDE 'intranet-bottom.inc' %]
112
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-38 / +44 lines)
Lines 2-49 Link Here
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Price %]
4
[% USE Price %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% borrower.firstname %] [% borrower.surname %]</title>
7
<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for  [% borrower.firstname %] [% borrower.surname %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
<script type= "text/javascript">
10
//<![CDATA[
11
function enableCheckboxActions(){
12
    // Enable/disable controls if checkboxes are checked
13
    var checkedBoxes = $("input.cb:checked");
14
    if ($(checkedBoxes).size()) {
15
      $("#payselected").prop("disabled",false);
16
    } else {
17
      $("#payselected").prop("disabled",true);
18
    }
19
}
20
    $(document).ready(function(){
21
 $('#pay-fines-form').preventDoubleFormSubmit();
22
        $("#woall").click(function(event){
23
            var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" );
24
            var answer = confirm(msg);
25
                if (!answer){
26
                    event.preventDefault();
27
                }
28
        });
29
        $('#CheckAll').click(function(){
30
            $("#finest").checkCheckboxes();
31
            enableCheckboxActions();
32
            return false;
33
        });
34
        $('#CheckNone').click(function(){
35
            $("#finest").unCheckCheckboxes();
36
            enableCheckboxActions();
37
            return false;
38
        });
39
        $(".cb").change(function(){
40
            enableCheckboxActions();
41
        });
42
        enableCheckboxActions();
43
    });
44
//]]>
45
</script>
46
</head>
9
</head>
10
47
<body id="pat_pay" class="pat">
11
<body id="pat_pay" class="pat">
48
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
49
[% INCLUDE 'patron-search.inc' %]
13
[% INCLUDE 'patron-search.inc' %]
Lines 179-182 function enableCheckboxActions(){ Link Here
179
[% INCLUDE 'circ-menu.inc' %]
143
[% INCLUDE 'circ-menu.inc' %]
180
</div>
144
</div>
181
</div>
145
</div>
146
147
[% MACRO jsinclude BLOCK %]
148
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
149
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
150
    <script type= "text/javascript">
151
        function enableCheckboxActions(){
152
            // Enable/disable controls if checkboxes are checked
153
            var checkedBoxes = $("input.cb:checked");
154
            if ($(checkedBoxes).size()) {
155
              $("#payselected").prop("disabled",false);
156
            } else {
157
              $("#payselected").prop("disabled",true);
158
            }
159
        }
160
        $(document).ready(function(){
161
        $('#pay-fines-form').preventDoubleFormSubmit();
162
            $("#woall").click(function(event){
163
                var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" );
164
                var answer = confirm(msg);
165
                    if (!answer){
166
                        event.preventDefault();
167
                    }
168
            });
169
            $('#CheckAll').click(function(){
170
                $("#finest").checkCheckboxes();
171
                enableCheckboxActions();
172
                return false;
173
            });
174
            $('#CheckNone').click(function(){
175
                $("#finest").unCheckCheckboxes();
176
                enableCheckboxActions();
177
                return false;
178
            });
179
            $(".cb").change(function(){
180
                enableCheckboxActions();
181
            });
182
            enableCheckboxActions();
183
        });
184
185
    </script>
186
[% END %]
187
182
[% INCLUDE 'intranet-bottom.inc' %]
188
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-60 / +64 lines)
Lines 1-68 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
5
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<script type= "text/javascript">
7
//<![CDATA[
8
$(document).ready(function() {
9
    $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit();
10
    $("#paid").on("change",function(){
11
        moneyFormat( this );
12
    });
13
});
14
15
function moneyFormat(textObj) {
16
    var newValue = textObj.value;
17
    var decAmount = "";
18
    var dolAmount = "";
19
    var decFlag   = false;
20
    var aChar     = "";
21
22
    for(i=0; i < newValue.length; i++) {
23
        aChar = newValue.substring(i, i+1);
24
        if (aChar >= "0" && aChar <= "9") {
25
            if(decFlag) {
26
                decAmount = "" + decAmount + aChar;
27
            }
28
            else {
29
                dolAmount = "" + dolAmount + aChar;
30
            }
31
        }
32
        if (aChar == ".") {
33
            if (decFlag) {
34
                dolAmount = "";
35
                break;
36
            }
37
            decFlag = true;
38
        }
39
    }
40
41
    if (dolAmount == "") {
42
        dolAmount = "0";
43
    }
44
// Strip leading 0s
45
    if (dolAmount.length > 1) {
46
        while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
47
            dolAmount = dolAmount.substring(1,dolAmount.length);
48
        }
49
    }
50
    if (decAmount.length > 2) {
51
        decAmount = decAmount.substring(0,2);
52
    }
53
// Pad right side
54
    if (decAmount.length == 1) {
55
       decAmount = decAmount + "0";
56
    }
57
    if (decAmount.length == 0) {
58
       decAmount = decAmount + "00";
59
    }
60
61
    textObj.value = dolAmount + "." + decAmount;
62
}
63
//]]>
64
</script>
65
</head>
7
</head>
8
66
<body id="pat_paycollect" class="pat">
9
<body id="pat_paycollect" class="pat">
67
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'header.inc' %]
68
[% INCLUDE 'patron-search.inc' %]
11
[% INCLUDE 'patron-search.inc' %]
Lines 232-236 function moneyFormat(textObj) { Link Here
232
[% INCLUDE 'circ-menu.inc' %]
175
[% INCLUDE 'circ-menu.inc' %]
233
</div>
176
</div>
234
</div>
177
</div>
235
[% INCLUDE 'intranet-bottom.inc' %]
236
178
179
[% MACRO jsinclude BLOCK %]
180
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
181
    <script type= "text/javascript">
182
        $(document).ready(function() {
183
            $('#payindivfine, #woindivfine, #payfine').preventDoubleFormSubmit();
184
            $("#paid").on("change",function(){
185
                moneyFormat( this );
186
            });
187
        });
188
189
        function moneyFormat(textObj) {
190
            var newValue = textObj.value;
191
            var decAmount = "";
192
            var dolAmount = "";
193
            var decFlag   = false;
194
            var aChar     = "";
195
196
            for(i=0; i < newValue.length; i++) {
197
                aChar = newValue.substring(i, i+1);
198
                if (aChar >= "0" && aChar <= "9") {
199
                    if(decFlag) {
200
                        decAmount = "" + decAmount + aChar;
201
                    }
202
                    else {
203
                        dolAmount = "" + dolAmount + aChar;
204
                    }
205
                }
206
                if (aChar == ".") {
207
                    if (decFlag) {
208
                        dolAmount = "";
209
                        break;
210
                    }
211
                    decFlag = true;
212
                }
213
            }
214
215
            if (dolAmount == "") {
216
                dolAmount = "0";
217
            }
218
        // Strip leading 0s
219
            if (dolAmount.length > 1) {
220
                while(dolAmount.length > 1 && dolAmount.substring(0,1) == "0") {
221
                    dolAmount = dolAmount.substring(1,dolAmount.length);
222
                }
223
            }
224
            if (decAmount.length > 2) {
225
                decAmount = decAmount.substring(0,2);
226
            }
227
        // Pad right side
228
            if (decAmount.length == 1) {
229
               decAmount = decAmount + "0";
230
            }
231
            if (decAmount.length == 0) {
232
               decAmount = decAmount + "00";
233
            }
234
235
            textObj.value = dolAmount + "." + decAmount;
236
        }
237
    </script>
238
[% END %]
239
240
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt (-2 / +8 lines)
Lines 1-11 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Print Receipt for [% cardnumber %]</title>
5
<title>Print receipt for [% cardnumber %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice.css" />
7
[% INCLUDE 'slip-print.inc' #printThenClose %]
8
</head>
8
</head>
9
9
<body id="pat_printfeercpt" class="pat">
10
<body id="pat_printfeercpt" class="pat">
10
11
11
<div id="receipt">
12
<div id="receipt">
Lines 73-76 Link Here
73
  </tfoot>
74
  </tfoot>
74
</table>
75
</table>
75
</div>
76
</div>
77
78
[% MACRO jsinclude BLOCK %]
79
    [% INCLUDE 'slip-print.inc' #printThenClose %]
80
[% END %]
81
76
[% INCLUDE 'intranet-bottom.inc' %]
82
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt (-1 / +7 lines)
Lines 1-10 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Print receipt for [% cardnumber %]</title>
4
<title>Print receipt for [% cardnumber %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/printreceiptinvoice.css" />
6
[% INCLUDE 'slip-print.inc' #printThenClose %]
7
</head>
7
</head>
8
8
<body id="printinvoice" class="pat">
9
<body id="printinvoice" class="pat">
9
10
10
<div id="receipt">
11
<div id="receipt">
Lines 74-77 Link Here
74
  </tfoot>
75
  </tfoot>
75
</table>
76
</table>
76
</div>
77
</div>
78
79
[% MACRO jsinclude BLOCK %]
80
    [% INCLUDE 'slip-print.inc' #printThenClose %]
81
[% END %]
82
77
[% INCLUDE 'intranet-bottom.inc' %]
83
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/purchase-suggestions.tt (-11 / +17 lines)
Lines 1-21 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AuthorisedValues  %]
2
[% USE AuthorisedValues  %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' %]</title>
6
<title>Koha &rsaquo; Patrons &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' %]</title>
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'datatables.inc' %]
9
<script type="text/javascript">
10
    $(document).ready(function() {
11
        $("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, {
12
            'bPaginate': false,
13
            'bFilter': false,
14
            'bInfo': false,
15
            'sDom': 't'
16
        } ));
17
    });
18
</script>
19
</head>
9
</head>
20
10
21
<body id="pat_purchase_suggestions" class="pat">
11
<body id="pat_purchase_suggestions" class="pat">
Lines 108-111 Link Here
108
[% INCLUDE 'circ-menu.inc' %]
98
[% INCLUDE 'circ-menu.inc' %]
109
</div>
99
</div>
110
</div>
100
</div>
101
102
[% MACRO jsinclude BLOCK %]
103
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
104
    [% INCLUDE 'datatables.inc' %]
105
    <script type="text/javascript">
106
        $(document).ready(function() {
107
            $("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, {
108
                'bPaginate': false,
109
                'bFilter': false,
110
                'bInfo': false,
111
                'sDom': 't'
112
            } ));
113
        });
114
    </script>
115
[% END %]
116
111
[% INCLUDE 'intranet-bottom.inc' %]
117
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-28 / +32 lines)
Lines 2-40 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
7
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript" id="js">
11
//<![CDATA[
12
13
 $(document).ready(function() {
14
    var table = $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
15
        "sPaginationType": "four_button",
16
        "aaSorting": [],
17
        "aoColumnDefs": [
18
            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
19
            { "sType": "title-string", "aTargets" : [ "title-string" ] }
20
        ]
21
    }));
22
    var tabs = $("#tabs").tabs({
23
        activate: function(e, ui) {
24
            var active = tabs.tabs("option", "active" );
25
            if ( active == 1 ) {
26
                table.fnFilter("standard_checkout", 0);
27
            } else if ( active == 2 ) {
28
                table.fnFilter("onsite_checkout", 0);
29
            } else { // all
30
                table.fnFilter('', 0);
31
            }
32
        }
33
    });
34
 });
35
//]]>
36
</script>
37
</head>
10
</head>
11
38
<body id="pat_readingrec" class="pat">
12
<body id="pat_readingrec" class="pat">
39
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'header.inc' %]
40
[% INCLUDE 'patron-search.inc' %]
14
[% INCLUDE 'patron-search.inc' %]
Lines 142-145 Link Here
142
[% INCLUDE 'circ-menu.inc' %]
116
[% INCLUDE 'circ-menu.inc' %]
143
</div>
117
</div>
144
</div>
118
</div>
119
120
[% MACRO jsinclude BLOCK %]
121
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
122
    [% INCLUDE 'datatables.inc' %]
123
    <script type="text/javascript" id="js">
124
        $(document).ready(function() {
125
            var table = $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
126
                "sPaginationType": "four_button",
127
                "aaSorting": [],
128
                "aoColumnDefs": [
129
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
130
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
131
                ]
132
            }));
133
            var tabs = $("#tabs").tabs({
134
                activate: function(e, ui) {
135
                    var active = tabs.tabs("option", "active" );
136
                    if ( active == 1 ) {
137
                        table.fnFilter("standard_checkout", 0);
138
                    } else if ( active == 2 ) {
139
                        table.fnFilter("onsite_checkout", 0);
140
                    } else { // all
141
                        table.fnFilter('', 0);
142
                    }
143
                }
144
            });
145
        });
146
    </script>
147
[% END %]
148
145
[% INCLUDE 'intranet-bottom.inc' %]
149
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt (+7 lines)
Lines 1-10 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</title>
6
<title>Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
</head>
8
</head>
9
8
<body id="pat_routing_lists" class="pat">
10
<body id="pat_routing_lists" class="pat">
9
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
10
[% INCLUDE 'patron-search.inc' %]
12
[% INCLUDE 'patron-search.inc' %]
Lines 80-83 Link Here
80
[% INCLUDE 'circ-menu.inc' %]
82
[% INCLUDE 'circ-menu.inc' %]
81
</div>
83
</div>
82
</div>
84
</div>
85
86
[% MACRO jsinclude BLOCK %]
87
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
88
[% END %]
89
83
[% INCLUDE 'intranet-bottom.inc' %]
90
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/statistics.tt (-10 / +15 lines)
Lines 1-22 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo;
6
<title>Koha &rsaquo; Patrons &rsaquo;
6
Statistics for [% INCLUDE 'patron-title.inc' %]
7
Statistics for [% INCLUDE 'patron-title.inc' %]
7
</title>
8
</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
11
[% INCLUDE 'calendar.inc' %]
12
<script type="text/javascript">
13
    $(document).ready(function() {
14
        $("#statistics").dataTable($.extend(true, {}, dataTablesDefaults, {
15
            "sDom": 't',
16
            "bPaginate": false
17
        }));
18
    });
19
</script>
20
</head>
11
</head>
21
12
22
<body id="pat_statistics" class="pat">
13
<body id="pat_statistics" class="pat">
Lines 94-97 Statistics for [% INCLUDE 'patron-title.inc' %] Link Here
94
[% INCLUDE 'circ-menu.inc' %]
85
[% INCLUDE 'circ-menu.inc' %]
95
</div>
86
</div>
96
</div>
87
</div>
88
89
[% MACRO jsinclude BLOCK %]
90
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
91
    [% INCLUDE 'datatables.inc' %]
92
    <script type="text/javascript">
93
        $(document).ready(function() {
94
            $("#statistics").dataTable($.extend(true, {}, dataTablesDefaults, {
95
                "sDom": 't',
96
                "bPaginate": false
97
            }));
98
        });
99
    </script>
100
[% END %]
101
97
[% INCLUDE 'intranet-bottom.inc' %]
102
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt (-44 / +41 lines)
Lines 1-55 Link Here
1
[% SET footerjs = 1 %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Choose Adult category</title>
3
<title>Koha &rsaquo; Choose adult category</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
5
[% INCLUDE 'datatables.inc' %]
6
<style type="text/css">
6
<script type="text/javascript">
7
    #custom-doc { width:29em;*width:28.3em;min-width:377px; margin:auto; text-align:left; }
7
	$(document).ready(function() {
8
</style>
8
        $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
9
            "sDom": 't',
10
            "aaSorting": [[ 2, "asc" ]],
11
            "aoColumnDefs": [
12
                { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
13
            ],
14
            "bPaginate": false
15
        }));
16
	});
17
</script>
18
<style type="text/css"> 
19
	   #custom-doc { width:29em;*width:28.3em;min-width:377px; margin:auto; text-align:left; } 
20
</style> 
21
</head>
9
</head>
10
22
<body id="pat_update-child" class="pat">
11
<body id="pat_update-child" class="pat">
23
12
24
<div id="custom-doc" class="yui-t7">
13
<div id="custom-doc" class="yui-t7">
25
<div id="bd">
14
<div id="bd">
26
15
27
[% IF ( CONFIRM ) %]
28
<script type="text/javascript">
29
function confirm_updatechild() {
30
    var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult category?  This cannot be undone.');
31
   
32
    if (is_confirmed) {
33
            window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
34
    }
35
}
36
37
confirm_updatechild([% borrowernumber %]);
38
</script>
39
[% END %]
40
41
[% IF ( SUCCESS ) %]
42
<script type="text/javascript">
43
self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
44
window.close();
45
</script>
46
[% END %]
47
48
49
50
[% IF ( MULTI ) %]
16
[% IF ( MULTI ) %]
51
17
52
    <h3> Choose Adult category </h3>
18
    <h3> Choose adult category </h3>
53
19
54
    [% IF patron_categories %]
20
    [% IF patron_categories %]
55
        <form method="post" action="update-child.pl">
21
        <form method="post" action="update-child.pl">
Lines 87-96 window.close(); Link Here
87
        </form>
53
        </form>
88
    [% END %]
54
    [% END %]
89
[% END %]
55
[% END %]
56
</div>
90
57
58
[% MACRO jsinclude BLOCK %]
59
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu.js"></script>
60
    [% INCLUDE 'datatables.inc' %]
61
    <script type="text/javascript">
62
        $(document).ready(function() {
63
            $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
64
                "sDom": 't',
65
                "aaSorting": [[ 2, "asc" ]],
66
                "aoColumnDefs": [
67
                    { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
68
                ],
69
                "bPaginate": false
70
            }));
71
        });
72
    </script>
73
    [% IF ( CONFIRM ) %]
74
        <script type="text/javascript">
75
            function confirm_updatechild() {
76
                var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult category?  This cannot be undone.');
77
                if (is_confirmed) {
78
                        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
79
                }
80
            }
91
81
82
            confirm_updatechild([% borrowernumber %]);
83
        </script>
84
    [% END %]
85
    [% IF ( SUCCESS ) %]
86
        <script type="text/javascript">
87
            self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
88
            window.close();
89
        </script>
90
    [% END %]
91
[% END %]
92
92
93
94
95
</div>
96
[% INCLUDE 'popup-bottom.inc' %]
93
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (+154 lines)
Line 0 Link Here
1
/* global borrowernumber advsearch dateformat _ CAN_user_borrowers NorwegianPatronDBEnable CATCODE_MULTI catcode destination */
2
3
$(document).ready(function(){
4
    $("#filteraction_off, #filteraction_on").on('click', function(e) {
5
        e.preventDefault();
6
        $('#filters').toggle();
7
        $('.filteraction').toggle();
8
    });
9
    if( advsearch ){
10
        $("#filteraction_on").toggle();
11
        $("#filters").show();
12
    } else {
13
        $("#filteraction_off").toggle();
14
    }
15
    $("#searchfieldstype").change(function() {
16
        var MSG_DATE_FORMAT = "";
17
        if ( $(this).val() == 'dateofbirth' ) {
18
            if( dateformat == 'us' ){
19
                MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'");
20
            } else if( dateformat == 'iso' ){
21
                MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'");
22
            } else if( dateformat == 'metric' ){
23
                MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'");
24
            } else if( dateformat == 'dmydot' ){
25
                MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'");
26
            }
27
            $('#searchmember').attr("title", MSG_DATE_FORMAT).tooltip('show');
28
        } else {
29
            $('#searchmember').tooltip('destroy');
30
        }
31
    });
32
33
    if( CAN_user_borrowers ){
34
        if( NorwegianPatronDBEnable == 1 ){
35
            $("#deletepatronlocal").click(function(){
36
                confirm_local_deletion();
37
                $(".btn-group").removeClass("open");
38
                return false;
39
            });
40
            $("#deletepatronremote").click(function(){
41
                confirm_remote_deletion();
42
                $(".btn-group").removeClass("open");
43
                return false;
44
            });
45
            $("#deletepatronboth").click(function(){
46
                confirm_both_deletion();
47
                $(".btn-group").removeClass("open");
48
                return false;
49
            });
50
        } else {
51
            $("#deletepatron").click(function(){
52
                window.location='/cgi-bin/koha/members/deletemem.pl?member=' + borrowernumber;
53
            });
54
        }
55
        $("#renewpatron").click(function(){
56
            confirm_reregistration();
57
            $(".btn-group").removeClass("open");
58
            return false;
59
        });
60
        $("#updatechild").click(function(){
61
            update_child();
62
            $(".btn-group").removeClass("open");
63
        });
64
    }
65
66
    $("#updatechild, #patronflags, #renewpatron, #deletepatron, #exportbarcodes").tooltip();
67
    $("#exportcheckins").click(function(){
68
        export_barcodes();
69
        $(".btn-group").removeClass("open");
70
        return false;
71
    });
72
    $("#printsummary").click(function(){
73
        printx_window("page");
74
        $(".btn-group").removeClass("open");
75
        return false;
76
    });
77
    $("#printslip").click(function(){
78
        printx_window("slip");
79
        $(".btn-group").removeClass("open");
80
        return false;
81
    });
82
    $("#printquickslip").click(function(){
83
        printx_window("qslip");
84
        $(".btn-group").removeClass("open");
85
        return false;
86
    });
87
    $("#print_overdues").click(function(){
88
        window.open("/cgi-bin/koha/members/print_overdues.pl?borrowernumber=" + borrowernumber, "printwindow");
89
        $(".btn-group").removeClass("open");
90
        return false;
91
    });
92
    $("#searchtohold").click(function(){
93
        searchToHold();
94
        return false;
95
    });
96
    $("#select_patron_messages").on("change",function(){
97
        $("#borrower_message").val( $(this).val() );
98
    });
99
});
100
function confirm_local_deletion() {
101
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the local database? This cannot be undone."));
102
    if (is_confirmed) {
103
        window.location='/cgi-bin/koha/members/deletemem.pl?member=' + borrowernumber + '&deletelocal=true&deleteremote=false';
104
    }
105
}
106
function confirm_remote_deletion() {
107
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron from the Norwegian national patron database? This cannot be undone."));
108
    if (is_confirmed) {
109
        window.location='/cgi-bin/koha/members/deletemem.pl?member=' + borrowernumber + '&deletelocal=false&deleteremote=true';
110
    }
111
}
112
function confirm_both_deletion() {
113
    var is_confirmed = window.confirm(_("Are you sure you want to delete this patron both from the local database and from the Norwegian national patron database? This cannot be undone."));
114
    if (is_confirmed) {
115
        window.location='/cgi-bin/koha/members/deletemem.pl?member=' + borrowernumber + '&deletelocal=true&deleteremote=true';
116
    }
117
}
118
119
function confirm_updatechild() {
120
    var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category?  This cannot be undone."));
121
    if (is_confirmed) {
122
        window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=' + borrowernumber + '&catcode=' + catcode + '&catcode_multi=' + CATCODE_MULTI;
123
    }
124
}
125
126
function update_child() {
127
    if( CATCODE_MULTI ){
128
        window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=' + borrowernumber,'UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes');
129
    } else {
130
        confirm_updatechild();
131
    }
132
}
133
134
function confirm_reregistration() {
135
    var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?"));
136
    if (is_confirmed) {
137
        window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=' + borrowernumber + '&amp;destination=' + destination + '&amp;reregistration=y';
138
    }
139
}
140
function export_barcodes() {
141
    window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=' + borrowernumber + '&amp;op=export_barcodes');
142
}
143
var slip_re = /slip/;
144
function printx_window(print_type) {
145
    var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
146
    window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=" + borrowernumber + "&amp;print=" + print_type, "printwindow");
147
    return false;
148
}
149
function searchToHold(){
150
    var date = new Date();
151
    date.setTime(date.getTime() + (10 * 60 * 1000));
152
    $.cookie("holdfor", borrowernumber, { path: "/", expires: date });
153
    location.href="/cgi-bin/koha/catalogue/search.pl";
154
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js (+20 lines)
Line 0 Link Here
1
$(document).ready(function(){
2
    $(".none").click(function(){
3
        if($(this).prop("checked")){
4
            var rowid = $(this).attr("id");
5
            var newid = Number(rowid.replace("none",""));
6
            $("#sms"+newid).prop("checked", false);
7
            $("#email"+newid).prop("checked", false);
8
            $("#phone"+newid).prop("checked", false);
9
            $("#digest"+newid).prop("checked", false);
10
            $("#rss"+newid).prop("checked", false);
11
        }
12
    });
13
    $(".active_notify").on("change",function(){
14
        var attr_id = $(this).data("attr-id");
15
        if( $(this).prop("checked") ){
16
            $("#none" + attr_id ).prop("checked", false);
17
        }
18
    });
19
    $("#info_digests").tooltip();
20
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/circulation.js (-1 / +24 lines)
Lines 85-90 $(document).ready(function() { Link Here
85
        $("#itemSearchFallback").modal("show");
85
        $("#itemSearchFallback").modal("show");
86
    });
86
    });
87
87
88
    // Debarments
89
    $("div#reldebarments .remove_restriction").on("click",function(){
90
        return confirm(_("Remove restriction?"));
91
    });
92
    var mrform = $("#manual_restriction_form");
93
    var mrlink = $("#add_manual_restriction");
94
    mrform.hide();
95
    mrlink.on("click",function(e){
96
        $(this).hide();
97
        mrform.show();
98
        e.preventDefault();
99
    });
100
    $("#cancel_manual_restriction").on("click",function(e){
101
        mrlink.show();
102
        mrform.hide();
103
        e.preventDefault();
104
    });
105
    $(".clear-date").on("click",function(e){
106
        e.preventDefault();
107
        var fieldID = this.id.replace("clear-date-","");
108
        $("#" + fieldID).val("");
109
    });
110
111
88
});
112
});
89
113
90
function export_checkouts(format) {
114
function export_checkouts(format) {
91
- 

Return to bug 19641