diff --git a/CHANGELOG.md b/CHANGELOG.md index cee5f17b..f46508a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added ### Changed +- Fix to bugreport #827 ### Removed diff --git a/module/Client/view/client/client/details.phtml b/module/Client/view/client/client/details.phtml index 7a5895e3..e17971f7 100644 --- a/module/Client/view/client/client/details.phtml +++ b/module/Client/view/client/client/details.phtml @@ -91,7 +91,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Client/view/client/client/index.phtml b/module/Client/view/client/client/index.phtml index 9e031f97..45c965a5 100644 --- a/module/Client/view/client/client/index.phtml +++ b/module/Client/view/client/client/index.phtml @@ -67,7 +67,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Dashboard/view/dashboard/dashboard/index.phtml b/module/Dashboard/view/dashboard/dashboard/index.phtml index bf30e75a..71e69d77 100644 --- a/module/Dashboard/view/dashboard/dashboard/index.phtml +++ b/module/Dashboard/view/dashboard/dashboard/index.phtml @@ -45,7 +45,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Fileset/view/fileset/fileset/details.phtml b/module/Fileset/view/fileset/fileset/details.phtml index 089ca608..67c513a0 100644 --- a/module/Fileset/view/fileset/fileset/details.phtml +++ b/module/Fileset/view/fileset/fileset/details.phtml @@ -64,7 +64,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Job/view/job/job/actions.phtml b/module/Job/view/job/job/actions.phtml index 2ad1ac45..dc52050d 100644 --- a/module/Job/view/job/job/actions.phtml +++ b/module/Job/view/job/job/actions.phtml @@ -85,7 +85,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Job/view/job/job/details.phtml b/module/Job/view/job/job/details.phtml index e9d6a026..11a276ed 100644 --- a/module/Job/view/job/job/details.phtml +++ b/module/Job/view/job/job/details.phtml @@ -110,7 +110,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Job/view/job/job/index.phtml b/module/Job/view/job/job/index.phtml index e2ef81dc..2a5cd9e9 100644 --- a/module/Job/view/job/job/index.phtml +++ b/module/Job/view/job/job/index.phtml @@ -91,7 +91,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); @@ -259,9 +259,9 @@ $this->headTitle($title); case 'W': switch(row.type) { case 'B': - return '" id="btn-1"> " id="btn-1">'; + return '" id="btn-1"> " id="btn-1">'; case 'C': - return '" id="btn-1">'; + return '" id="btn-1">'; } case 'E': case 'e': diff --git a/module/Media/view/media/media/details.phtml b/module/Media/view/media/media/details.phtml index 5306fad7..59ebe4e8 100644 --- a/module/Media/view/media/media/details.phtml +++ b/module/Media/view/media/media/details.phtml @@ -103,7 +103,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Media/view/media/media/index.phtml b/module/Media/view/media/media/index.phtml index ffffbcba..1a06b5e2 100644 --- a/module/Media/view/media/media/index.phtml +++ b/module/Media/view/media/media/index.phtml @@ -70,7 +70,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Pool/view/pool/pool/details.phtml b/module/Pool/view/pool/pool/details.phtml index bb65840c..50bae428 100644 --- a/module/Pool/view/pool/pool/details.phtml +++ b/module/Pool/view/pool/pool/details.phtml @@ -102,7 +102,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Pool/view/pool/pool/index.phtml b/module/Pool/view/pool/pool/index.phtml index 8ced1d77..c50670dd 100644 --- a/module/Pool/view/pool/pool/index.phtml +++ b/module/Pool/view/pool/pool/index.phtml @@ -69,7 +69,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Schedule/view/schedule/schedule/index.phtml b/module/Schedule/view/schedule/schedule/index.phtml index 16414ae0..7ea80dc4 100644 --- a/module/Schedule/view/schedule/schedule/index.phtml +++ b/module/Schedule/view/schedule/schedule/index.phtml @@ -86,7 +86,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Storage/view/storage/storage/details.phtml b/module/Storage/view/storage/storage/details.phtml index 47c23f9b..334f2195 100644 --- a/module/Storage/view/storage/storage/details.phtml +++ b/module/Storage/view/storage/storage/details.phtml @@ -170,7 +170,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/module/Storage/view/storage/storage/index.phtml b/module/Storage/view/storage/storage/index.phtml index f76d5a43..cced032d 100644 --- a/module/Storage/view/storage/storage/index.phtml +++ b/module/Storage/view/storage/storage/index.phtml @@ -65,7 +65,7 @@ $this->headTitle($title); headScript()->prependFile($this->basePath() . '/js/datatables.functions.js'); + echo $this->headScript()->prependFile($this->basePath() . '/js/custom-functions.js'); echo $this->headLink()->prependStylesheet($this->basePath() . '/css/bootstrap-table.min.css'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-locale-all.min.js'); echo $this->headScript()->prependFile($this->basePath() . '/js/bootstrap-table-cookie.min.js'); diff --git a/public/js/datatables.functions.js b/public/js/custom-functions.js similarity index 95% rename from public/js/datatables.functions.js rename to public/js/custom-functions.js index 7064e823..8a90f986 100644 --- a/public/js/datatables.functions.js +++ b/public/js/custom-functions.js @@ -165,14 +165,23 @@ function formatJobLevel(data) { } function formatRetention(data) { - var retention; - //retention = Math.round( (data / 60 / 60 / 24) ); - retention = Math.floor((data % 31536000) / 86400); - if(retention == 0) { - return '-'; + if( Math.floor(data / 31536000) >= 1 ) { + return Math.floor(data / 31536000) + ' ' + iJS._('year(s)'); + } + else if( Math.floor(data / 2678400) >= 1 ) { + return Math.floor(data / 2678400) + ' ' + iJS._('month(s)'); + } + else if( Math.floor(data / 86400) >= 1 ) { + return Math.floor(data / 86400) + ' ' + iJS._('day(s)'); + } + else if( Math.floor(data / 3600) >= 1 ) { + return Math.floor(data / 3600) + ' ' + iJS._('hour(s)'); + } + else if( Math.floor(data / 60) >= 1 ) { + return Math.floor(data / 60) + ' ' + iJS._('second(s)'); } else { - return retention + ' ' + iJS._('day(s)'); + return '-'; } } @@ -202,7 +211,7 @@ function formatExpiration(volstatus, lastwritten, volretention) { } } else { - return Math.ceil((volretention / 60 / 60 / 24)) + ' ' + iJS._("day(s)"); + return formatRetention(volretention); } }