@@ -, +, @@ cellular providers template - Go to Administration -> SMS cellular providers. - If necessary, create a new SMS cellular provider. - Edit at least one patron to use an SMS cellular provider under "Patron messaging preferences." - In the table of SMS cellular providers: - Click the "Edit" button. The correct edit form should be displayed. - Click the "Delete" button next to a provider which is not used by any patrons. You should see an error message, "Are you sure you want to delete [provider name]." Test both cancel and confirm. - Click the "Delete" button next to a provider which is in use by one or more patrons. YOu should see an error message, "Are you sure you want to delete [provider name]? X patron(s) are using it!" Test both cancel and confirm. --- koha-tmpl/intranet-tmpl/prog/en/js/sms_providers.js | 15 +++++++++++++++ .../prog/en/modules/admin/sms_providers.tt | 19 +++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/sms_providers.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/sms_providers.js @@ -5,6 +5,21 @@ $(document).ready(function() { $("#new_provider").on("click",function(){ add_provider(); }); + $(".edit").on("click",function(e){ + e.preventDefault(); + var providerid = $(this).data("providerid"); + edit_provider( providerid ); + }); + $(".delete").on("click",function(e){ + e.preventDefault(); + var providerid = $(this).data("providerid"); + var patrons_using = $(this).data("patrons_using"); + if( patrons_using !== "" ){ + delete_provider( providerid, patrons_using ); + } else { + delete_provider( providerid ); + } + }); }); function clear_form(){ --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt @@ -38,7 +38,6 @@ Domain Patrons   -   @@ -48,21 +47,13 @@ [% p.name %] [% p.domain %] [% p.patrons_using %] - - + + Edit - - - [% IF p.patrons_using %] - - Delete - - [% ELSE %] - - Delete - - [% END %] + + Delete + [% END %] --