From 24c02c907da9cc19a77e70f2aeb3a0ef666c8910 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 1 Oct 2020 12:10:39 -0300 Subject: [PATCH] Bug 26595: Add SMTP server column to libraries table This patch makes the libraries datatable render the assigned SMTP server on each row. 'Default' will be rendered when the system default is detected. A link to the SMTP server config will be rendered when a real SMTP server is assigned. To test: 1. Apply this patches, reload al the things 2. Visit the libraries table => SUCCESS: There's an SMTP server column displaying the right thing 3. Assign an SMTP server to a library => SUCCESS: The table displays the server name as a link => SUCCESS: The link correctly points to the SMTP server config page 4. Sign off --- .../prog/en/modules/admin/branches.tt | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt index 2d5d59ca91..64c53b89bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -209,6 +209,7 @@ MARC organization code IP Pickup location + SMTP server Actions @@ -243,9 +244,10 @@ "ajax": { "url": libraries_url }, + 'embed': [ 'smtp_server_info' ], 'emptyTable': '
'+_("There are no libraries defined.")+' '+_("Start defining libraries")+'.
', "columnDefs": [ { - "targets": [0,1,3,4,7,8,9,10,11,12,13,14,15], + "targets": [0,1,3,4,6,8,9,10,11,12,13,14,15], "render": function (data, type, row, meta) { if ( type == 'display' ) { if ( data != null ) { @@ -316,6 +318,20 @@ return (data) ? _("Yes") : _("No"); } }, + { + "data": "smtp_server_info", + "render": function( data, type, row, meta ) { + if ( data.name == 'system_default' ) { + return _("Default"); + } + else { + return ''+data.name.escapeHtml()+''; + } + }, + "searchable": false, + "visible": true, + "orderable": false + }, { "data": function( row, type, val, meta ) { @@ -384,7 +400,7 @@ "searchable": true, "visible": false, "orderable": false - }, + } ] }, columns_settings); -- 2.28.0