From 723734513b8696cccb53eede7294b408e46d0225 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 17 May 2012 12:58:30 -0400 Subject: [PATCH] Bug 7889 [Authorities duplicates] Use standard style for errors and messages The warning shown in the authorities editor when there is a possible duplicate is styled incorrectly. In addition the design of the warning is inconsistent with that shown in the bibliographic record editor. This patch revises the style and layout of the duplicate error box. It also corrects a problem which appears in the biblio and authority editors where a non-existent JS window function was called. I have added the function to the default JS include and revised the editor pages to use it. To test: - Create a record in both the cataloging and authorities editors which will trigger a duplicate warning. - Click the link to the existing record. A separate window should pop up. - In both editors try each option: - Confirm the duplicate and go to the existing record. - Deny that the record is duplicate and continue to save. Signed-off-by: Chris Cormack --- .../intranet-tmpl/prog/en/js/staff-global.js | 9 ++- .../en/modules/authorities/authorities.tt | 80 ++++++++++--------- .../prog/en/modules/cataloguing/addbiblio.tt | 2 +- 3 files changed, 52 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 24b785d1e5..bf45048dd8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -101,4 +101,11 @@ jQuery.fn.preventDoubleFormSubmit = function() { else this.beenSubmitted = true; }); -}; \ No newline at end of file +}; + +function openWindow(link,name,width,height) { + name = (typeof name == "undefined")?'popup':name; + width = (typeof width == "undefined")?'600':width; + height = (typeof height == "undefined")?'400':height; + var newin=window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top'); +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index d720b3594b..651236068f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -520,6 +520,31 @@ function searchauthority() { opacity: 0.8 }); })(); + $(document).ready(function() { + yuiToolbar(); + $("#addauthc,#action").empty(); + }); + // YUI Toolbar Functions + function yuiToolbar() { + var addauthButton = new YAHOO.widget.Button({ + id: "addauth", + type: "button", + label: "Save", + container: "addauthc", + onclick: {fn: Check } + }); + var addauthButton2 = new YAHOO.widget.Button({ + id: "addauth2", + type: "button", + label: "Save", + container: "action", + onclick: {fn: Check } + }); + } + function confirmnotdup(redirect){ + $("#confirm_not_duplicate").attr("value","1"); + Check(); + } //]]> [% INCLUDE 'header.inc' %] @@ -536,53 +561,34 @@ function searchauthority() {

Modify authority #[% authid %] [% authtypetext %]

[% ELSE %]

Adding authority [% authtypetext %]

-[% END %] +[% END %] + +[% IF ( duplicateauthid ) %] +
+

Duplicate record suspected

+

Is this a duplicate of [% duplicateauthvalue %]?

+ +
+ + +
+
+ +
+
+[% END %] +
+
-
-[% IF ( duplicateauthid ) %] -
-

Duplicate suspected with [% duplicateauthvalue %]

-

You must either :

- -
-[% END %] -
    [% FOREACH BIG_LOO IN BIG_LOOP %]
  • [% IF ( BIG_LOO.number ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index da22e93a1a..a9e98411e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -675,7 +675,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? [% IF ( duplicatebiblionumber ) %]

    Duplicate record suspected

    -

    Is this a duplicate of [% duplicatetitle %]?

    +

    Is this a duplicate of [% duplicatetitle %]?

    [% IF ( CAN_user_editcatalogue_edit_items ) %] -- 2.39.5