From e7786f478fd1cd0830a5a8dd4a8ed9be7f07515b Mon Sep 17 00:00:00 2001
From: Damien Burel <damien.burel@maarch.org>
Date: Thu, 23 Feb 2017 14:37:45 +0100
Subject: [PATCH] FEAT #5233 Back button

---
 modules/visa/Controllers/VisaController.php | 2 ++
 modules/visa/Views/signatureBook.html       | 4 ++--
 modules/visa/css/module.css                 | 9 +--------
 modules/visa/js/aController.js              | 5 +++++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/visa/Controllers/VisaController.php b/modules/visa/Controllers/VisaController.php
index 614ca931641..0e993f5fa91 100644
--- a/modules/visa/Controllers/VisaController.php
+++ b/modules/visa/Controllers/VisaController.php
@@ -64,6 +64,8 @@ class VisaController {
 				}
 			}
 
+			$attachments[$key]['truncateTitle'] = ((strlen($value['title']) > 20) ? (substr($value['title'], 0, 20) . '...') : $value['title']);
+
 			$attachments[$key]['thumbnailLink'] = "index.php?page=doc_thumb&module=thumbnails&res_id={$realId}&coll_id={$collId}&display=true&advanced=true";
 			$attachments[$key]['viewerLink'] = "index.php?display=true&module=visa&page=view_pdf_attachement&res_id_master={$resId}&id={$viewerId}";
 
diff --git a/modules/visa/Views/signatureBook.html b/modules/visa/Views/signatureBook.html
index 0ded39b274b..f357c5ca973 100644
--- a/modules/visa/Views/signatureBook.html
+++ b/modules/visa/Views/signatureBook.html
@@ -16,7 +16,7 @@
             <i class="fa fa-line-chart fa-2x"></i>
         </div>
         <div class="others">
-            
+            <i style="cursor: pointer" ng-click="backToBasket()" class="fa fa-backward fa-lg"></i>
         </div>
         <div class="actions">
             <select id="signatureBookActions">
@@ -49,7 +49,7 @@
             <div class="contentShow">
                 <div class="pjDetails">
                     <div class="infoPj"><label>Type : </label><span>{{signatureBook.attachments[signatureBook.rightSelectedThumbnail].attachment_type}}</span></div>
-                    <div class="infoPj"><label>Objet : </label><span>{{signatureBook.attachments[signatureBook.rightSelectedThumbnail].title}}</span></div>
+                    <div class="infoPj"><label>Objet : </label><span>{{signatureBook.attachments[signatureBook.rightSelectedThumbnail].truncateTitle}}</span></div>
                     <div class="infoPj"><label>Contact : </label><span>Laurent GIOVANONNI - 11 boulevard du sud est</span></div>
                 </div>
                 <div class="pjDetailsMore">
diff --git a/modules/visa/css/module.css b/modules/visa/css/module.css
index 022d33294b4..22d1706c83c 100644
--- a/modules/visa/css/module.css
+++ b/modules/visa/css/module.css
@@ -84,7 +84,6 @@
 	height: 96%;
 	width: 100%;
 	overflow-y: scroll;
-	overflow-x: none;
 }
 
 .listDocsBasket div{
@@ -252,6 +251,7 @@
         display: table-cell;
         padding: 5px;
         vertical-align: middle;
+         text-align: right;
     }
     
     .headerSignatureBook .item.activeTabSignatureBook,.panelRight .panelSelectedThumbnail{
@@ -406,13 +406,6 @@
         vertical-align: middle;
     }
     
-     .headerSignatureBook .others{
-        border-right: solid 1px black;
-        display: table-cell;
-        padding: 5px;
-        vertical-align: middle;
-    }
-    
     .headerSignatureBook .item.activeTabSignatureBook,.panelRight .panelSelectedThumbnail{
         background: #009DC5;
         color:white;
diff --git a/modules/visa/js/aController.js b/modules/visa/js/aController.js
index 70ba995e83c..ae281721568 100644
--- a/modules/visa/js/aController.js
+++ b/modules/visa/js/aController.js
@@ -35,6 +35,11 @@ mainApp.controller("visaCtrl", ["$scope", "$http", "$routeParams", "$interval",
     $scope.signatureBook.leftSelectedThumbnail = index;
   };
 
+  $scope.backToBasket = function() {
+    location.hash = "";
+    location.reload();
+  };
+
   $scope.validForm = function() {
     //$interval.cancel(intervalPromise);
     unlockDocument($routeParams.resId);
-- 
GitLab