Bugzilla – Attachment 191170 Details for
Bug 41580
Tidy kohaTable block - tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41580: Tidy kohaTable - tools/upload.tt
0c45d77.patch (text/plain), 3.64 KB, created by
Jonathan Druart
on 2026-01-09 14:53:44 UTC
(
hide
)
Description:
Bug 41580: Tidy kohaTable - tools/upload.tt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:53:44 UTC
Size:
3.64 KB
patch
obsolete
>From 0c45d77d1922df30d0ed49d87227cffd497e1a6d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jan 2026 16:17:45 +0100 >Subject: [PATCH] Bug 41580: Tidy kohaTable - tools/upload.tt > >--- > .../prog/en/modules/tools/upload.tt | 44 ++++++++++++------- > 1 file changed, 28 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >index 00d5862a3e2..16ceb2f1767 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >@@ -360,6 +360,22 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("js/file-upload.js") | $raw %] >+ <script> >+ var plugin = [% plugin ? 1 : 0 | html %]; >+ var plugin_index = "[% index | html %]"; >+ >+ var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'upload', 'uploadresults', 'json' ) | $raw %]; >+ if (plugin){ >+ table_settings['columns'].splice(6, 1); >+ table_settings['columns'].splice(5, 1); >+ } >+ >+ addPrefs({ >+ OPACBaseURL: "[% Koha.Preference('OPACBaseURL') | html %]", >+ }); >+ const msg_alert = "[% msg | html %]"; >+ </script> >+ > <script> > function StartUpload() { > if( $('#fileToUpload').prop('files').length == 0 ) return; >@@ -378,12 +394,12 @@ > if( $("#uploadcategory").val() ) > cat = encodeURIComponent( $("#uploadcategory").val() ); > if( cat ) xtra= 'category=' + cat + '&'; >- [% IF plugin %] >+ if (plugin){ > xtra = xtra + 'public=1&temp=0'; >- [% ELSE %] >+ } else { > if( !cat ) xtra = 'temp=1&'; > if( $('#public').prop('checked') ) xtra = xtra + 'public=1'; >- [% END %] >+ } > xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), xtra, cbUpload ); > } > function CancelUpload() { >@@ -473,30 +489,26 @@ > $("#form_delete").submit(); > } > function ClearField() { >- [% IF plugin %] >- $(window.opener.document).find('#[% index | html %]').val( '' ); >- [% END %] >+ if (plugin){ >+ $(window.opener.document).find('#' + plugin_index).val( '' ); >+ } > } > function Choose(hashval) { >- var res = '[% Koha.Preference('OPACBaseURL') | html %]'; >+ var res = prefs.OPACBaseURL; > res = res.replace( /\/$/, ''); > res = res + '/cgi-bin/koha/opac-retrieve-file.pl?id=' + hashval; >- var index = '[% index | html %]'; >+ var index = plugin_index; > index = index.replace( /^buttonDot_/, '' ); > if(index) $(window.opener.document).find('#'+index).val( res ); > window.close(); > } >- var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'upload', 'uploadresults', 'json' ) | $raw %]; >- [% IF plugin %] >- table_settings['columns'].splice(6, 1); >- table_settings['columns'].splice(5, 1); >- [% END %] >+ > $(document).ready(function() { > $("#uploadresults").kohaTable({}, table_settings); > >- [% IF msg %] >- ShowAlerts( [% msg | html %] ); >- [% END %] >+ if (msg_alert){ >+ ShowAlerts(msg_alert); >+ } > $("#fileuploadcancel").hide(); > $("#public_cb").click(function() { > $("#public").click(); >-- >2.43.0 >
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 41580
:
191163
|
191164
|
191165
|
191166
|
191167
|
191168
|
191169
| 191170 |
191171