From 0872bf8c2e7d6404fe297a542a4b644f5e47cd9d Mon Sep 17 00:00:00 2001
From: Roch D'Amour <roch.damour@inlibro.com>
Date: Thu, 22 Feb 2018 13:43:46 -0500
Subject: [PATCH] Bug 11317 - File with same name in different directories now
 has distinct hash + QA followup

---
 .../prog/en/modules/reports/reports-home.tt        | 24 ++++++++---------
 .../prog/en/modules/tools/access_files.tt          | 31 +++++++++++-----------
 tools/access_files.pl                              |  2 +-
 3 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt
index 557b16c..ff0a13a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt
@@ -49,27 +49,27 @@
     </div>
 
     <div class="yui-u"><h2>Top lists</h2>
-	<ul>
+        <ul>
         <li><a href="/cgi-bin/koha/reports/bor_issues_top.pl">Patrons with the most checkouts</a></li>
         <li><a href="/cgi-bin/koha/reports/cat_issues_top.pl">Most-circulated items</a></li>
-	</ul>
+        </ul>
 
-	<h2>Inactive</h2>
-	<ul>
-		<li><a href="/cgi-bin/koha/reports/borrowers_out.pl">Patrons who haven't checked out</a></li>
-		<li><a href="/cgi-bin/koha/reports/catalogue_out.pl">Items with no checkouts</a></li>
-	</ul>
+        <h2>Inactive</h2>
+        <ul>
+                <li><a href="/cgi-bin/koha/reports/borrowers_out.pl">Patrons who haven't checked out</a></li>
+                <li><a href="/cgi-bin/koha/reports/catalogue_out.pl">Items with no checkouts</a></li>
+        </ul>
 
-	<h2>Other</h2>
-	<ul>
-		<li><a href="/cgi-bin/koha/reports/itemslost.pl">Items lost</a></li>
+        <h2>Other</h2>
+        <ul>
+                <li><a href="/cgi-bin/koha/reports/itemslost.pl">Items lost</a></li>
         <li><a href="/cgi-bin/koha/reports/orders_by_fund.pl">Orders by fund</a></li>
         <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">Catalog by item type</a></li>
-		<li><a href="/cgi-bin/koha/reports/issues_avg_stats.pl">Average loan time</a></li>
+                <li><a href="/cgi-bin/koha/reports/issues_avg_stats.pl">Average loan time</a></li>
         <li><a href="http://schema.koha-community.org/" target="blank">Koha database schema</a></li>
         <li><a href="http://wiki.koha-community.org/wiki/SQL_Reports_Library" target="blank">Koha reports library</a></li>
         <!--<li><a href="/cgi-bin/koha/reports/stats.screen.pl">Till reconciliation</a></li> -->
-	</ul></div>
+        </ul></div>
 </div>
 
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt
index 1f8a394..4999565 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/access_files.tt
@@ -1,21 +1,9 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Report/log files</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables_[% KOHA_VERSION %].css" />
 [% INCLUDE 'datatables.inc' %]
-<script type="text/JavaScript" language="JavaScript">
-    //<![CDATA[
-        $(document).ready(function() {
-            $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
-                "sDom": 't',
-                "aoColumnDefs": [
-                    { "aTargets": [ -1 ], "asSorting" : [ "desc", "asc" ], "bSearchable": false }
-                ],
-                "bPaginate": false
-            }));
-    });
-    //]]>
-</script>
+
 </head>
 <body>
 [% INCLUDE 'header.inc' %]
@@ -63,4 +51,17 @@
 [% INCLUDE 'tools-menu.inc' %]
 </div>
 </div>
-[% INCLUDE 'intranet-bottom.inc' %]
+<script type="text/JavaScript" language="JavaScript">
+    //<![CDATA[
+        $(document).ready(function() {
+            $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
+                "sDom": 't',
+                "aoColumnDefs": [
+                    { "aTargets": [ -1 ], "asSorting" : [ "desc", "asc" ], "bSearchable": false }
+                ],
+                "bPaginate": false
+            }));
+    });
+    //]]>
+</script>
+[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
diff --git a/tools/access_files.pl b/tools/access_files.pl
index 0fb57af..61b3abe 100755
--- a/tools/access_files.pl
+++ b/tools/access_files.pl
@@ -53,8 +53,8 @@ else {
     foreach my $dir(@directories){
         opendir(DIR, $dir);
         foreach my $filename (readdir(DIR)) {
-        my $id = md5_hex($filename);
             my $full_path = "$dir/$filename";
+        my $id = md5_hex($full_path);
             next if ($filename =~ /^\./ or -d $full_path);
 
             my $st = stat($full_path);
-- 
2.7.4