From b36327d91ae27863faae2fa453c4545fa3a96c59 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 Content-Type: text/plain; charset="utf-8" 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. --- admin/printers.pl | 16 +- .../prog/en/includes/printers-admin-search.inc | 28 ---- .../prog/en/modules/admin/printers.tt | 162 +++++++++------------ 3 files changed, 71 insertions(+), 135 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 9e0163b..cb43148 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 7d75a71..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc +++ /dev/null @@ -1,28 +0,0 @@ -
-

[% 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 62c0258..d194100 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.1.4