Bug 10442: Remove references to non-standard "error" class
authorOwen Leonard <oleonard@myacpl.org>
Mon, 13 Aug 2018 13:39:42 +0000 (13:39 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Nov 2018 13:20:37 +0000 (14:20 +0100)
The CSS for <div class="error"> is obsolete and should not be used. This
patch removes the definition from the main CSS file and corrects
instances of its use in the templates to the standard <div class="dialog
alert">.

To test:

- In Acquisitions -> Late orders, locate an order from a vendor which
  doesn't have an email address. Selecting that order and clicking
  "Claim" should trigger an error dialog, "This vendor has no email." It
  should be styled correctly.

- With  AcqCreateItem set to "when placing an order," add to an existing
  order using the "From a new (empty) record" option. Add two items with
  identical barcodes and submit the form. A error should show at
  the top of the page.

- With AcqCreateItem set to "when receiving an order," receive an order
  and add two items with identical barcodes. Submitting the form should
  trigger an error message at the top of the page.

With the remaining cases I don't know how to trigger the errors in
question, so a visual check of the changes may be required:

- Administration -> Funds -> "You are not authorized to modify this
  fund"
- Administration -> Search engine configuration
  (/admin/searchengine/elasticsearch/mappgings.pl) -> Various
  modification errors.
- With the  AutoEmailOpacUser preference set to "send," adding a patron
  without an email address can trigger an error, "This member has no
  email."
- With plugins enabled, and installed, there are error messages
  displayed under various circumstances.

Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 52028d9932ce1d10ad690261d8f6983b074b2909)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3557009b1668f9fbc20222fd4c2351b99beee5b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt
koha-tmpl/intranet-tmpl/prog/js/additem.js

index 2363765..cc2d27f 100644 (file)
@@ -85,11 +85,11 @@ $(document).ready(function() {
 
 [% IF error_claim %]
     [% IF ( error_claim == "no_email" ) %]
-        <div class="error">This vendor has no email</div>
+        <div class="dialog alert">This vendor has no email</div>
     [% ELSIF ( error_claim == "no_order_selected" ) %]
-        <div class="error">No order selected</div>
+        <div class="dialog alert">No order selected</div>
     [% ELSE %]
-        <div class="error">[% error_claim %]</div>
+        <div class="dialog alert">[% error_claim | html %]</div>
     [% END %]
 [% END %]
 [% IF info_claim %]
index 8087554..1425962 100644 (file)
@@ -219,7 +219,7 @@ $(document).ready(function()
     [% END %]
 </h2>
 
-<div class="error" style="display:none"></div>
+<div class="dialog alert order_error" style="display:none"></div>
 
 [% IF ( basketno ) %]
     <div id="acqui_basket_summary"  class="yui-g">
index 07aecdb..a21a4c5 100644 (file)
     <form action="/cgi-bin/koha/acqui/finishreceive.pl" method="post" onsubmit="return Check(this);">
 <div class="yui-g">
 <div class="yui-u first">
-    <div class="error" style="display:none"></div>
+    <div class="dialog alert order_error" style="display:none"></div>
 
     <fieldset class="rows">
     <legend>Catalog details</legend>
index 3637413..4255f1d 100644 (file)
@@ -286,7 +286,7 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget")
 [% UNLESS op == 'delete_confirm' %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
 
 [% IF (error_not_authorised_to_modify) %]
-    <div class="error">
+    <div class="dialog alert">
         <p>You are not authorized to modify this fund</p>
     </div>
 [% END %]
index 5a1ee80..5807b64 100644 (file)
@@ -87,11 +87,11 @@ a.add, a.delete {
     [% END %]
 
     <h1>Search engine configuration</h1>
-    <div class="warning">
+    <div class="dialog message">
         Warning: Any changes to the configuration will only take effect after a full reindex. Until then searching may not work correctly.
     </div>
     [% IF errors %]
-        <div class="error">
+        <div class="dialog alert">
         Changes have not been applied. Please check the following values:
           <ul>
             [% FOREACH e IN errors %]
index beab664..af84241 100644 (file)
@@ -148,9 +148,9 @@ $(document).ready(function() {
        <div class="yui-b">
     [% IF error_alert %]
         [% IF ( error_alert == "no_email" ) %]
-            <div class="error">This member has no email</div>
+            <div class="dialog alert">This member has no email</div>
         [% ELSE %]
-            <div class="error">[% error_alert %]</div>
+            <div class="dialog alert">[% error_alert | html %]</div>
         [% END %]
     [% END %]
     [% IF info_alert %]
index 29b9d75..b2d43d2 100644 (file)
                                         [% plugin.metadata.description %]
 
                                         [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
-                                            <div class="error">Warning: This report was written for a newer version of Koha. Run at your own risk.</div>
+                                            <div class="dialog alert">
+                                                Warning: This report was written for a newer version of Koha. Run at your own risk.
+                                            </div>
                                         [% END %]
 
                                         [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
-                                            <div class="error">Warning: This report was written for an older version of Koha. Run at your own risk.</div>
+                                            <div class="dialog alert">
+                                                Warning: This report was written for an older version of Koha. Run at your own risk.
+                                            </div>
                                         [% END %]
                                     </td>
                                     <td>[% plugin.metadata.author %]</td>
index 6e4bf33..78b5780 100644 (file)
@@ -249,7 +249,7 @@ function check_additem(unique_item_fields) {
     data['field'] = new Array();
     data['value'] = new Array();
     var array_fields = unique_item_fields.split(' ');
-    $(".error").empty(); // Clear error div
+    $(".order_error").empty(); // Clear error div
 
     // Check if a value is duplicated in form
     for ( field in array_fields ) {
@@ -270,7 +270,7 @@ function check_additem(unique_item_fields) {
         var sorted_arr = values.sort();
         for (var i = 0; i < sorted_arr.length - 1; i += 1) {
             if (sorted_arr[i + 1] == sorted_arr[i]) {
-                $(".error").append(
+                $(".order_error").append(
                     fieldname + " '" + sorted_arr[i] + "' "
                     + (window.MSG_ADDITEM_JS_IS_DUPLICATE || "is duplicated")
                     + "<br/>");
@@ -281,7 +281,7 @@ function check_additem(unique_item_fields) {
 
     // If there is a duplication, we raise an error
     if ( success == false ) {
-        $(".error").show();
+        $(".order_error").show();
         return false;
     }
 
@@ -295,7 +295,7 @@ function check_additem(unique_item_fields) {
                 success = false;
                 for (var i=0; i < data[field].length; i++) {
                     var value = data[field][i];
-                    $(".error").append(
+                    $(".order_error").append(
                         field + " '" + value + "' "
                         + (window.MSG_ADDITEM_JS_ALREADY_EXISTS_IN_DB
                             || "already exists in database")
@@ -307,7 +307,7 @@ function check_additem(unique_item_fields) {
     });
 
     if ( success == false ) {
-        $(".error").show();
+        $(".order_error").show();
     }
     return success;
 }