Bugzilla – Attachment 108647 Details for
Bug 22343
Add configuration options for SMTP servers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22343: Add CRUD page for SMTP servers
Bug-22343-Add-CRUD-page-for-SMTP-servers.patch (text/plain), 26.94 KB, created by
Kyle M Hall (khall)
on 2020-08-19 15:16:32 UTC
(
hide
)
Description:
Bug 22343: Add CRUD page for SMTP servers
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-08-19 15:16:32 UTC
Size:
26.94 KB
patch
obsolete
>From 3dfcd7df7ab7c43dfb159e2514953a845c49728f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 29 Jul 2020 17:35:50 -0300 >Subject: [PATCH] Bug 22343: Add CRUD page for SMTP servers > >This patch introduces a way to define SMTP servers either globally or >per-library. > >To test: >1. Apply this patch >2. Find the SMTP servers entry in the admin page >3. Play with adding/removing SMTP servers >=> SUCCESS: All works as expected >4. Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/smtp_servers.pl | 240 +++++++++++ > .../prog/en/modules/admin/admin-home.tt | 4 + > .../prog/en/modules/admin/smtp_servers.tt | 398 ++++++++++++++++++ > 3 files changed, 642 insertions(+) > create mode 100755 admin/smtp_servers.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt > >diff --git a/admin/smtp_servers.pl b/admin/smtp_servers.pl >new file mode 100755 >index 0000000000..8733f3fa07 >--- /dev/null >+++ b/admin/smtp_servers.pl >@@ -0,0 +1,240 @@ >+#!/usr/bin/perl >+ >+# Copyright 2020 Theke Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+use Scalar::Util qw(blessed); >+use Try::Tiny; >+ >+use C4::Auth qw(get_template_and_user); >+use C4::Output qw(output_html_with_http_headers); >+ >+use Koha::Libraries; >+use Koha::SMTP::Servers; >+ >+my $input = CGI->new; >+my $op = $input->param('op') || 'list'; >+ >+my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { template_name => "admin/smtp_servers.tt", >+ query => $input, >+ type => "intranet", >+ flagsrequired => { parameters => 1 }, >+ } >+); >+ >+my @messages; >+ >+if ( $op eq 'add' ) { >+ >+ my $library_id = $input->param('library_id'); >+ $library_id = undef >+ if defined $library_id and $library_id eq '*'; >+ >+ my $name = $input->param('smtp_name'); >+ my $host = $input->param('smtp_host'); >+ my $port = $input->param('smtp_port') || 25; >+ my $timeout = $input->param('smtp_timeout') || 120; >+ my $ssl_mode = $input->param('smtp_ssl_mode'); >+ my $user_name = $input->param('smtp_user_name') || undef; >+ my $password = $input->param('smtp_password') || undef; >+ my $debug = ( scalar $input->param('smtp_debug_mode') ) ? 1 : 0; >+ >+ try { >+ Koha::SMTP::Server->new( >+ { >+ library_id => $library_id, >+ name => $name, >+ host => $host, >+ port => $port, >+ timeout => $timeout, >+ ssl_mode => $ssl_mode, >+ user_name => $user_name, >+ password => $password, >+ debug => $debug, >+ } >+ )->store; >+ >+ push @messages, { type => 'message', code => 'success_on_insert' }; >+ } >+ catch { >+ if ( blessed $_ and $_->isa('Koha::Exceptions::Object::DuplicateID') ) { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_insert', >+ reason => 'duplicate_id' >+ }; >+ } >+ }; >+ >+ # list servers after adding >+ $op = 'list'; >+} >+elsif ( $op eq 'delete' ) { >+ my $smtp_server_id = $input->param('smtp_server_id'); >+ my $smtp_server; >+ >+ $smtp_server = Koha::SMTP::Servers->find($smtp_server_id) >+ unless !$smtp_server_id; >+ >+ if ( $smtp_server ) { >+ try { >+ my $name = $smtp_server->name; >+ $smtp_server->delete; >+ push @messages, >+ { >+ type => 'message', >+ code => 'success_on_delete' >+ }; >+ } >+ catch { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_delete' >+ }; >+ }; >+ } >+ else { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_delete', >+ reason => 'invalid_id' >+ }; >+ } >+ >+ # list servers after delete >+ $op = 'list'; >+} >+elsif ( $op eq 'edit_form' ) { >+ my $smtp_server_id = $input->param('smtp_server_id'); >+ my $smtp_server; >+ >+ $smtp_server = Koha::SMTP::Servers->find($smtp_server_id) >+ unless !$smtp_server_id; >+ >+ if ( $smtp_server ) { >+ $template->param( >+ smtp_server => $smtp_server >+ ); >+ } >+ else { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_edit', >+ reason => 'invalid_id' >+ }; >+ } >+} >+elsif ( $op eq 'edit_save' ) { >+ >+ my $smtp_server_id = $input->param('smtp_server_id'); >+ my $smtp_server; >+ >+ $smtp_server = Koha::SMTP::Servers->find($smtp_server_id) >+ unless !$smtp_server_id; >+ >+ if ( $smtp_server ) { >+ >+ my $name = $input->param('smtp_name'); >+ my $host = $input->param('smtp_host'); >+ my $port = $input->param('smtp_port') || 25; >+ my $timeout = $input->param('smtp_timeout') || 120; >+ my $ssl_mode = $input->param('smtp_ssl_mode'); >+ my $user_name = $input->param('smtp_user_name') || undef; >+ my $password = $input->param('smtp_password') || undef; >+ my $debug = ( scalar $input->param('smtp_debug_mode') ) ? 1 : 0; >+ >+ try { >+ $smtp_server->password( $password ) >+ if $password; >+ >+ $smtp_server->set( >+ { >+ name => $name, >+ host => $host, >+ port => $port, >+ timeout => $timeout, >+ ssl_mode => $ssl_mode, >+ user_name => $user_name, >+ debug => $debug >+ } >+ )->store; >+ >+ push @messages, >+ { >+ type => 'message', >+ code => 'success_on_update' >+ }; >+ } >+ catch { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_update' >+ }; >+ }; >+ >+ # list servers after adding >+ $op = 'list'; >+ } >+ else { >+ push @messages, >+ { >+ type => 'alert', >+ code => 'error_on_update', >+ reason => 'invalid_id' >+ }; >+ } >+} >+ >+if ( $op eq 'list' ) { >+ my $smtp_servers = Koha::SMTP::Servers->search; >+ $template->param( >+ servers_count => $smtp_servers->count, >+ default_config => $smtp_servers->default_setting >+ ); >+} >+ >+my @already_set_library_ids = Koha::SMTP::Servers->search( >+ { >+ library_id => { '!=' => undef } >+ } >+)->get_column('library_id'); >+ >+my $libraries = Koha::Libraries->search( >+ { >+ 'me.branchcode' => { -not_in => \@already_set_library_ids } >+ } >+); >+ >+my $default = Koha::SMTP::Servers->search({ library_id => undef })->count; >+ >+$template->param( >+ op => $op, >+ default_set => ( $default ) ? 1 : 0, >+ unset_libraries => $libraries, >+ messages => \@messages, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 0c02f258ab..9388dbe2d7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -208,6 +208,10 @@ > <dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a></dt> > <dd>Define which external servers to query for MARC data.</dd> > [% END %] >+ [% IF ( CAN_user_parameters ) %] >+ <dt><a href="/cgi-bin/koha/admin/smtp_servers.pl">SMTP servers</a></dt> >+ <dd>Define which SMTP servers to use.</dd> >+ [% END %] > [% IF ( CAN_user_parameters_manage_didyoumean ) %] > <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt> > <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt >new file mode 100644 >index 0000000000..cac27fa5be >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt >@@ -0,0 +1,398 @@ >+[% USE raw %] >+[% USE Asset %] >+[% SET footerjs = 1 %] >+[% USE TablesSettings %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Administration › SMTP servers >+[% IF op == 'add_form' %] >+ ›[% IF library %]Modify SMTP server[% ELSE %]New SMTP server[% END %] >+[% ELSIF op == 'delete_confirm' %] >+ › Confirm deletion of SMTP server '[% server.name | html %]' >+[% END %] >+</title> >+[% INCLUDE 'doc-head-close.inc' %] >+</head> >+ >+<body id="admin_smtp_servers" class="admin"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'prefs-admin-search.inc' %] >+ >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> › >+ <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › >+ <a href="/cgi-bin/koha/admin/smtp_servers.pl">SMTP servers</a> >+[% IF op == 'add_form' %] >+ › <span> New</span> >+[% ELSIF op == 'edit_form' %] >+ › <span> Edit</span> >+[% END %] >+</div> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ >+[% FOREACH m IN messages %] >+ <div class="dialog [% m.type | html %]"> >+ [% SWITCH m.code %] >+ [% CASE 'error_on_edit' %] >+ An error occurred trying to open the server for editing. The passed id is invalid. >+ [% CASE 'error_on_insert' %] >+ An error occurred when adding the server. The library already has an SMTP server set. >+ [% CASE 'error_on_delete' %] >+ An error occurred when deleting this server. Check the logs. >+ [% CASE 'success_on_update' %] >+ Server updated successfully. >+ [% CASE 'success_on_insert' %] >+ Server added successfully. >+ [% CASE 'success_on_delete' %] >+ Server deleted successfully. >+ [% CASE %] >+ [% m.code | html %] >+ [% END %] >+ </div> >+[% END %] >+ >+[% IF op == 'add_form' %] >+ <h3>New SMTP server</h3> >+ <form action="/cgi-bin/koha/admin/smtp_servers.pl" id="add" name="add" class="validated" method="post"> >+ <input type="hidden" name="op" value="add" /> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="library_id" class="required">Library: </label> >+ <select name="library_id" id="library_id"> >+ [%- UNLESS default_set -%] >+ <option value="*">All libraries</option> >+ [%- END -%] >+ [%- FOREACH library IN unset_libraries -%] >+ <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option> >+ [%- END -%] >+ </select> >+ <span class="required">Required</span> >+ </li> >+ </select> >+ <li> >+ <label for="smtp_name" class="required">Name: </label> >+ <input type="text" name="smtp_name" id="smtp_name" size="60" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset> >+ >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="smtp_host">Host: </label> >+ <input type="text" name="smtp_host" id="smtp_host" size="60" class="required"/> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="smtp_port">Port: </label> >+ <input type="number" step="1" value="25" name="smtp_port" id="smtp_port" size="20" class="required"/> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="smtp_timeout">Timeout (seconds): </label> >+ <input type="number" step="1" value="120" name="smtp_timeout" id="smtp_timeout" size="20" /> >+ </li> >+ <li> >+ <label for="smtp_ssl_mode">SSL: </label> >+ <select name="smtp_ssl_mode" id="smtp_ssl_mode"> >+ <option value="disabled" selected="selected">Disabled</option> >+ <option value="ssl">SSL</option> >+ <option value="starttls">STARTTLS</option> >+ </select> >+ </li> >+ <li> >+ <label for="smtp_user_name">User name: </label> >+ <input type="text" name="smtp_user_name" id="smtp_user_name" size="60" /> >+ </li> >+ <li> >+ <label for="smtp_password">Password: </label> >+ <input type="password" name="smtp_password" id="smtp_password" size="60" /> >+ </li> >+ <li> >+ <label for="smtp_debug_mode">Debug mode: </label> >+ <select name="smtp_debug_mode" id="smtp_debug_mode"> >+ <option value="1">Enabled</option> >+ <option value="0" selected="selected">Disabled</option> >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" /> >+ <a class="cancel" href="/cgi-bin/koha/admin/smtp_servers.pl">Cancel</a> >+ </fieldset> >+ </form> >+[% END %] >+ >+[% IF op == 'edit_form' %] >+ <h3>Edit SMTP server</h3> >+ <form action="/cgi-bin/koha/admin/smtp_servers.pl" id="edit_save" name="edit_save" class="validated" method="post"> >+ <input type="hidden" name="op" value="edit_save" /> >+ <input type="hidden" name="smtp_server_id" value="[%- smtp_server.id | html -%]" /> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="library_id">Library: </label> >+ [% IF smtp_server.library %] >+ <span name="library_id" id="library_id">[%- smtp_server.library.branchname | html -%]</span> >+ [%- ELSE -%] >+ <span name="library_id" id="library_id">All libraries</span> >+ [%- END -%] >+ </li> >+ </select> >+ <li> >+ <label for="smtp_name" class="required">Name: </label> >+ <input type="text" name="smtp_name" id="smtp_name" size="60" class="required" required="required" value="[%- smtp_server.name | html -%]"/> >+ <span class="required">Required</span> >+ </li> >+ </ol> >+ </fieldset> >+ >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="smtp_host">Host: </label> >+ <input type="text" name="smtp_host" id="smtp_host" size="60" class="required" value="[%- smtp_server.host | html -%]"/> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="smtp_port">Port: </label> >+ <input type="number" step="1" name="smtp_port" id="smtp_port" size="20" class="required" value="[%- smtp_server.port | html -%]"/> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="smtp_timeout">Timeout (seconds): </label> >+ <input type="number" step="1" name="smtp_timeout" id="smtp_timeout" size="20" value="[%- smtp_server.timeout | html -%]"/> >+ </li> >+ <li> >+ <label for="smtp_ssl_mode">SSL: </label> >+ <select name="smtp_ssl_mode" id="smtp_ssl_mode"> >+ [%- IF smtp_server.ssl_mode == 'disabled' -%] >+ <option value="disabled" selected="selected">Disabled</option> >+ <option value="ssl">SSL</option> >+ <option value="starttls">STARTTLS</option> >+ [%- ELSIF smtp_server.ssl_mode == 'ssl' -%] >+ <option value="disabled">Disabled</option> >+ <option value="ssl" selected="selected">SSL</option> >+ <option value="starttls">STARTTLS</option> >+ [%- ELSE -%] >+ <option value="disabled">Disabled</option> >+ <option value="ssl">SSL</option> >+ <option value="starttls" selected="selected">STARTTLS</option> >+ [%- END -%] >+ </select> >+ </li> >+ <li> >+ <label for="smtp_user_name">User name: </label> >+ <input type="text" name="smtp_user_name" id="smtp_user_name" size="60" value="[%- smtp_server.user_name | html -%]"/> >+ </li> >+ <li> >+ <label for="smtp_password">Password: </label> >+ <input type="password" name="smtp_password" id="smtp_password" size="60" value="[%- smtp_server.password | html -%]"/> >+ </li> >+ <li> >+ <label for="smtp_debug_mode">Debug mode: </label> >+ <select name="smtp_debug_mode" id="smtp_debug_mode"> >+ [%- IF smtp_server.debug == 1 -%] >+ <option value="1" selected="selected">Enabled</option> >+ <option value="0">Disabled</option> >+ [%- ELSE -%] >+ <option value="1">Enabled</option> >+ <option value="0" selected="selected">Disabled</option> >+ [%- END -%] >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" /> >+ <a class="cancel" href="/cgi-bin/koha/admin/smtp_servers.pl">Cancel</a> >+ </fieldset> >+ </form> >+[% END %] >+ >+[% IF op == 'list' %] >+ >+ [%- IF unset_libraries.count > 0 -%] >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="new_smtp_server" href="/cgi-bin/koha/admin/smtp_servers.pl?op=add_form"><i class="fa fa-plus"></i> New SMTP server</a> >+ </div> >+ [%- END -%] >+ >+ <h3>SMTP servers</h3> >+ >+ [% IF servers_count > 0 %] >+ <table id="smtp_servers"> >+ <thead> >+ <tr> >+ <th>Library</th> >+ <th>Name</th> >+ <th>Host</th> >+ <th>Port</th> >+ <th>Timeout (secs)</th> >+ <th>SSL</th> >+ <th>Authenticated</th> >+ <th data-class-name="actions">Actions</th> >+ </tr> >+ </thead> >+ </table> >+ [% ELSE %] >+ <div class="dialog message">No user-defined SMTP servers. Using the default configuration: >+ <ul> >+ <li><strong>Host</strong>: [%- default_config.host | html -%]</li> >+ <li><strong>Port</strong>: [%- default_config.port | html -%]</li> >+ <li><strong>Timeout (secs)</strong>: [%- default_config.timeout | html -%]</li> >+ <li><strong>SSL</strong>: [%- IF default_config.ssl_mode == 'disabled' -%]Disabled[%- ELSIF default_config.ssl_mode == 'ssl' -%]SSL[%- ELSE -%]STARTTLS[%- END -%]</li> >+ <li><strong>Debug mode</strong>: [%- IF default_config.debug -%]Yes[%- ELSE -%]No[%- END -%]</li> >+ </ul> >+ </pre> >+ </div> >+ [% END %] >+[% END %] >+ >+ <div id="delete_confirm_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete_confirm_modal_label" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >+ <h3 id="delete_confirm_modal_label">Delete server</h3> >+ </div> >+ <div class="modal-body"> >+ <div id="delete_confirm_dialog"></div> >+ </div> >+ <div class="modal-footer"> >+ <a href="#" class="btn btn-default" id="delete_confirm_modal_button" role="button" data-toggle="modal">Delete</a> >+ <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button> >+ </div> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+ </div> <!-- #delete_confirm_modal --> >+ >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'admin-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/admin-menu.js") | $raw %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ [% Asset.js("lib/tiny_mce/tinymce.min.js") | $raw %] >+ [% INCLUDE 'str/tinymce_i18n.inc' %] >+ <script> >+ $(document).ready(function() { >+ >+ var smtp_servers_url = '/api/v1/config/smtp_servers'; >+ var smtp_servers = $("#smtp_servers").api({ >+ "ajax": { >+ "url": smtp_servers_url >+ }, >+ "embed": [ >+ "library" >+ ], >+ 'emptyTable': '<div class="dialog message">'+_("There are no SMTP servers defined.")+'</div>', >+ "columnDefs": [ { >+ "targets": [0,1,2], >+ "render": function (data, type, row, meta) { >+ if ( type == 'display' ) { >+ if ( data != null ) { >+ return data.escapeHtml(); >+ } >+ else { >+ return "Default"; >+ } >+ } >+ return data; >+ } >+ } ], >+ "columns": [ >+ { >+ "data": "library.name", >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": "name", >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": "host", >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": "port", >+ "searchable": true, >+ "orderable": false >+ }, >+ { >+ "data": "timeout", >+ "searchable": true, >+ "orderable": false >+ }, >+ { >+ "data": "ssl_mode", >+ "render": function (data, type, row, meta) { >+ if (data == 'disabled') { >+ return _("Disabled"); >+ } >+ else if (data == 'ssl') { >+ return _("SSL"); >+ } >+ else { >+ return _("STARTTLS"); >+ } >+ }, >+ "searchable": false, >+ "orderable": false >+ }, >+ { >+ "data": function( row, type, val, meta ) { >+ if ( row.user_name != null ) { >+ return _("Yes"); >+ } >+ else { >+ return _("No"); >+ } >+ }, >+ "searchable": false, >+ "orderable": false >+ }, >+ { >+ "data": function( row, type, val, meta ) { >+ var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/admin/smtp_servers.pl?op=edit_form&smtp_server_id='+ encodeURIComponent(row.smtp_server_id) +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'+"\n"; >+ result += '<a class="btn btn-default btn-xs delete_server" role="button" href="#" data-toggle="modal" data-target="#delete_confirm_modal" data-smtp-server-id="'+ encodeURIComponent(row.smtp_server_id) +'" data-smtp-server-name="'+ encodeURIComponent(row.name) +'"><i class="fa fa-trash" aria-hidden="true"></i>'+_("Delete")+'</a>'; >+ return result; >+ }, >+ "searchable": false, >+ "orderable": false >+ } >+ ] >+ }); >+ >+ $('#smtp_servers').on( "click", '.delete_server', function () { >+ var smtp_server_id = $(this).data('smtp-server-id'); >+ var smtp_server_name = $(this).data('smtp-server-name'); >+ >+ $("#delete_confirm_dialog").html( >+ _("You are about to delete the \"%s\" SMTP server.").format(smtp_server_name) >+ ); >+ $("#delete_confirm_modal_button").attr("href", "/cgi-bin/koha/admin/smtp_servers.pl?op=delete&smtp_server_id=" + encodeURIComponent(smtp_server_id)); >+ }); >+ }); >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22343
:
107598
|
107599
|
107600
|
107601
|
107602
|
107603
|
107604
|
107605
|
107987
|
107988
|
107989
|
107990
|
107991
|
107992
|
107993
|
107994
|
107995
|
107996
|
107997
|
107998
|
107999
|
108009
|
108107
|
108108
|
108109
|
108110
|
108111
|
108112
|
108113
|
108114
|
108115
|
108116
|
108117
|
108118
|
108119
|
108131
|
108132
|
108133
|
108134
|
108135
|
108136
|
108137
|
108138
|
108139
|
108140
|
108141
|
108142
|
108143
|
108529
|
108537
|
108538
|
108539
|
108540
|
108541
|
108542
|
108543
|
108544
|
108545
|
108546
|
108547
|
108548
|
108549
|
108609
|
108638
|
108642
|
108643
|
108644
|
108645
|
108646
|
108647
|
108648
|
108649
|
108650
|
108651
|
108652
|
108653
|
108654
|
108655
|
108656
|
108715
|
108716
|
109003
|
109004
|
109005
|
109006
|
109007
|
109008
|
109009
|
109010
|
109011
|
109012
|
109013
|
109014
|
109015
|
109016
|
109017
|
109018
|
109155
|
109156
|
109157
|
109158
|
109159
|
109160
|
109161
|
109162
|
109163
|
109164
|
109165
|
109166
|
109167
|
109168
|
109169
|
109170
|
109601
|
109602
|
109603
|
109604
|
109605
|
109606
|
109607
|
109608
|
109609
|
109610
|
109611
|
109612
|
109613
|
109614
|
109615
|
109616
|
109723
|
109724
|
109725
|
109726
|
109727
|
109728
|
109729
|
109730
|
109731
|
109732
|
109733
|
109734
|
109735
|
109736
|
109737
|
109738
|
109739
|
109740
|
109787
|
109788
|
111048
|
111087
|
111088
|
111089
|
111090
|
111154
|
111165
|
111166
|
111175
|
111176
|
111213
|
111215
|
111216
|
111442
|
111482
|
113240
|
113827
|
113847