From 1d7490b6e50d0cdfd08124f5ca46eca4547d5ca6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 28 Jun 2013 15:10:14 -0400 Subject: [PATCH] Bug 10516 - Improve titles, breadcrumbs, and confirmation messages for Z39.50 server adds and updates The template for adding/editing Z39.50 servers shows the same title, breadcrumbs, etc. for add and edit operations. This patch creates separate text for each case. To test, try both adding and editing a Z39.50 server. The page title, breadcrumb, and heading should correctly reflect the operation you perform. Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Works nicely and all strings are translatable. Signed-off-by: Galen Charlton (cherry picked from commit 5c60ae40f97d9c22504c2942a00a93777984c7a5) Signed-off-by: Tomas Cohen Arazi --- admin/z3950servers.pl | 3 ++- .../prog/en/modules/admin/z3950servers.tt | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 92cc3e59f6..87711c1bb0 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -104,12 +104,12 @@ if ($op eq 'add_form') { ################## ADD_VALIDATE ################################## # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { - $template->param(add_validate => 1); my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("select * from z3950servers where name=?"); $sth->execute($input->param('searchfield')); my $checked = $input->param('checked') ? 1 : 0; if ($sth->rows) { + $template->param(confirm_update => 1); $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); $sth->execute($input->param('host'), $input->param('port'), @@ -126,6 +126,7 @@ if ($op eq 'add_form') { ); } else { + $template->param(confirm_add => 1); $sth=$dbh->prepare( "INSERT INTO z3950servers " . "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " . diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index 18f92fc9b2..fa61123a2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -2,7 +2,8 @@ Koha › Administration › [% IF ( else ) %]Z39.50 servers[% END %] [% IF ( add_form ) %] Z39.50 servers › [% IF ( searchfield ) %]Modify Z39.50 server [% searchfield %][% ELSE %]New Z39.50 server[% END %][% END %] [% IF ( delete_confirm ) %]Z39.50 servers › Confirm deletion[% END %] -[% IF ( add_validate ) %]Z39.50 servers › Z39.50 server added[% END %] +[% IF ( confirm_add ) %] Z39.50 servers › Z39.50 server added[% END %] +[% IF ( confirm_update ) %] Z39.50 servers › Z39.50 server updated[% END %] [% IF ( delete_confirmed ) %]Z39.50 servers › Z39.50 server deleted[% END %] [% INCLUDE 'doc-head-close.inc' %] [% IF ( else ) %] @@ -94,7 +95,9 @@
@@ -244,13 +247,20 @@ [% END %] -[% IF ( add_validate ) %] +[% IF ( confirm_add ) %]

Z39.50 server added

[% END %] +[% IF ( confirm_update ) %] +

Z39.50 server updated

+
+ +
+[% END %] + [% IF ( delete_confirm ) %] [% reqsel %]

Confirm deletion of server [% searchfield %]

-- 2.39.5