Bug 20248: (QA follow-up) Remove unnecessary stuff
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 8 Aug 2018 12:33:11 +0000 (14:33 +0200)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 22 Aug 2018 14:47:51 +0000 (14:47 +0000)
- Remove useless 'action' attribute in forms
- $op should never be equal to 'reset', so remove the test
- Move 'op' parameter inside <button>s to avoid having different HTML
  tags for elements that have the same kind of behaviour

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
admin/searchengine/elasticsearch/mappings.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt

index 12219d3..ecd8741 100755 (executable)
@@ -97,7 +97,7 @@ if ( $op eq 'edit' ) {
         $schema->storage->txn_commit;
     }
 }
-elsif( $op eq 'reset' || $op eq 'reset_confirmed' ) {
+elsif( $op eq 'reset_confirmed' ) {
     Koha::SearchMarcMaps->delete;
     Koha::SearchFields->delete;
     Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings;
index 9215aee..c049b01 100644 (file)
@@ -114,18 +114,17 @@ a.add, a.delete {
     [% IF reset_confirm %]
         <div class="dialog alert">
             <h3>The current mappings you see on the screen will be erased and replaced by the mappings in the mappings.yaml file.</h3>
-            <form action="?" method="post">
+            <form method="post">
                 <input type="hidden" name="op" value="reset_confirmed" />
                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, reset mappings</button>
             </form>
             <br>
-            <form action="?" method="post">
+            <form method="post">
                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not reset mappings</button>
             </form>
         </div>
     [% END %]
     <form method="post">
-        <input type="hidden" name="op" value="edit" />
         <div id="tabs" class="toptabs" style="clear:both">
             <ul>
                 <li><a href="#search_fields">Search fields</a></li>
@@ -314,8 +313,8 @@ a.add, a.delete {
             [% END %]
         </div>
         <p>
-            <button class="btn btn-default" type="submit"><i class="fa fa-hdd-o" aria-hidden="true"></i> Save</button>
-            <a class="btn btn-default" href="?op=reset_confirm"><i class="fa fa-refresh" aria-hidden="true"></i> Reset Mappings</a>
+            <button class="btn btn-default" type="submit" name="op" value="edit"><i class="fa fa-hdd-o" aria-hidden="true"></i> Save</button>
+            <button class="btn btn-default" type="submit" name="op" value="reset_confirm"><i class="fa fa-refresh" aria-hidden="true"></i> Reset Mappings</button>
         </p>
     </form>
 </div>