From 505ca939df661aae758d91d95ba237e32a9fa6b9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 20 May 2016 12:19:49 -0400 Subject: [PATCH] Bug 16764: Update printers administration page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch updates the template for printers administration according to current interface guidelines. - Custom JavaScript form validation is removed in favor of the built-in form validation plugin. - Printer-specific header search form is removed, along with server-side pagination code. The functionality of both is now taken care of the adding DataTables sorting and pagination to the table. - Edit and delete links are styled as Boostrap buttons with Font Awesome icons. - Confirmation dialogs are updated to use Font Awesome icons. To test properly you will need to add multiple printers. - Apply the patch and open /cgi-bin/koha/admin/printers.pl (there is no menu link for the page). - When no printers exist you should see a message dialog saying so. - Add a new printer. Confirm that printer name and queue are required fields. - After adding multiple printers, confirm that the table of printers is correctly sorted and searched by the DataTables plugin. - Delete a printer and verify that the confirmation dialog is correctly styled. Signed-off-by: Marc Véron Update: rebased and updated Bootstrap 3 classes Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- admin/printers.pl | 16 +- .../en/includes/printers-admin-search.inc | 30 ---- .../prog/en/modules/admin/printers.tt | 162 ++++++++---------- 3 files changed, 71 insertions(+), 137 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc diff --git a/admin/printers.pl b/admin/printers.pl index 9e0163bc77..cb43148804 100755 --- a/admin/printers.pl +++ b/admin/printers.pl @@ -60,10 +60,8 @@ sub StringSearch { my $input = new CGI; my $searchfield=$input->param('searchfield'); #my $branchcode=$input->param('branchcode'); -my $offset=$input->param('offset') || 0; my $script_name="/cgi-bin/koha/admin/printers.pl"; -my $pagesize=20; my $op = $input->param('op'); $searchfield=~ s/\,//g; @@ -132,19 +130,7 @@ if ($op eq 'add_form') { } else { # DEFAULT $template->param(else => 1); my ($count,$results)=StringSearch($searchfield,'web'); - my $max = ($offset+$pagesize < $count) ? $offset+$pagesize : $count; - my @loop = (@$results)[$offset..$max]; - - $template->param(loop => \@loop); - - if ($offset>0) { - $template->param(offsetgtzero => 1, - prevpage => $offset-$pagesize); - } - if ($offset+$pagesize<$count) { - $template->param(ltcount => 1, - nextpage => $offset+$pagesize); - } + $template->param(loop => $results); } #---- END $OP eq DEFAULT diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc deleted file mode 100644 index 3bd8e28430..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc +++ /dev/null @@ -1,30 +0,0 @@ -[% USE Koha %] -
-

[% LibraryName %]

- -
- diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt index 45e6d398ed..1090afcee1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/printers.tt @@ -6,53 +6,27 @@ [% IF ( delete_confirmed ) %] Printers › Printer deleted[% END %] [% IF ( else ) %]Printers[% END %] [% INCLUDE 'doc-head-close.inc' %] -[% IF ( add_form ) %] - [% END %] +[% END %] [% INCLUDE 'header.inc' %] -[% INCLUDE 'printers-admin-search.inc' %] +[% INCLUDE 'cat-search.inc' %] -- 2.39.5