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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-19 / +22 lines)
Lines 1051-1082 Link Here
1051
1051
1052
                [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
1052
                [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
1053
                    $('#update_privacy_guarantor_checkouts').click( function() {
1053
                    $('#update_privacy_guarantor_checkouts').click( function() {
1054
                        $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() }, null, 'json')
1054
                        var can_see_checkouts = $('#privacy_guarantor_checkouts').val() == 1;
1055
                         .done(function( data ) {
1055
                        $.ajax({
1056
                            var message;
1056
                            url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber %]/guarantors/can_see_checkouts"
1057
                            if ( data.success ) {
1057
                            type: "PUT",
1058
                                message = _("Your setting has been updated!");
1058
                            data: JSON.stringify({ allowed: can_see_checkouts }),
1059
                            } else {
1059
                            contentType: "application/json",
1060
                                message = _("Unable to update your setting!");
1060
                            success: function() {
1061
                                $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( _("Your setting has been updated!") ).delay( 5000 ).fadeOut("slow");
1062
                            },
1063
                            error: function() {
1064
                                $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( _("Unable to update your setting!") ).delay( 5000 ).fadeOut("slow");
1061
                            }
1065
                            }
1062
1063
                            $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow");
1064
                        });
1066
                        });
1065
                    });
1067
                    });
1066
                [% END %]
1068
                [% END %]
1067
1069
1068
                [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
1070
                [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
1069
                    $('#update_privacy_guarantor_fines').click( function() {
1071
                    $('#update_privacy_guarantor_fines').click( function() {
1070
                        $.post( "/cgi-bin/koha/svc/patron/show_fines_to_relatives", { privacy_guarantor_fines: $('#privacy_guarantor_fines').val() }, null, 'json')
1072
                        var can_see_charges = $('#privacy_guarantor_fines').val() == 1;
1071
                         .done(function( data ) {
1073
                        $.ajax({
1072
                            var message;
1074
                            url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber %]/guarantors/can_see_charges",
1073
                            if ( data.success ) {
1075
                            type: 'PUT',
1074
                                message = _("Your setting has been updated!");
1076
                            data: JSON.stringify({ allowed: can_see_charges }),
1075
                            } else {
1077
                            contentType: 'application/json',
1076
                                message = _("Unable to update your setting!");
1078
                            success: function() {
1079
                                $('#update_privacy_guarantor_fines_message').fadeIn("slow").text( _("Your setting has been updated!") ).delay( 5000 ).fadeOut("slow");
1080
                            },
1081
                            error: function() {
1082
                                $('#update_privacy_guarantor_fines_message').fadeIn("slow").text( _("Unable to update your setting!") ).delay( 5000 ).fadeOut("slow");
1077
                            }
1083
                            }
1078
1079
                            $('#update_privacy_guarantor_fines_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow");
1080
                        });
1084
                        });
1081
                    });
1085
                    });
1082
                [% END %]
1086
                [% END %]
1083
- 

Return to bug 23623