diff --git a/css/light-grey.scss b/css/light-grey.scss index bc62eca7b..f085f198f 100644 --- a/css/light-grey.scss +++ b/css/light-grey.scss @@ -3830,14 +3830,20 @@ input:checked + .slider:before { .pull-left { float: left; } -table.attachmentsList { - &>tbody{ - &>tr>td:first-child { - text-align: center; - } - &>tr>td:nth-child(3) { - text-align: right; - padding-right: 0.5em; +.attachmentsList { + >tbody{ + >tr>td{ + &[role="icon"] { + text-align: center; + padding: 0.25em; + } + &[role="formatted-size"] { + text-align: right; + padding-right: 0.5em; + } + &[role="delete"] { + text-align: center; + } } } } diff --git a/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php index 286f33a9f..e8a41e0a7 100755 --- a/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php @@ -1,9 +1,6 @@ */ Dict::Add('EN US', 'English', 'English', array( @@ -66,7 +62,7 @@ Dict::Add('EN US', 'English', 'English', array( 'Attachments:File:Thumbnail' => 'Icon', 'Attachments:File:Name' => 'File name', 'Attachments:File:Date' => 'Upload date', - 'Attachments:File:Creator' => 'Uploaded by', + 'Attachments:File:Uploader' => 'Uploaded by', 'Attachments:File:Size' => 'Size', 'Attachments:File:MimeType' => 'Type', )); \ No newline at end of file diff --git a/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php index 047e0e870..4b9ad416d 100755 --- a/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php @@ -1,26 +1,22 @@ /** - * Localized data + * Copyright (C) 2013-2020 Combodo SARL * - * @copyright Copyright (C) 2010-2012 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 + * This file is part of iTop. + * + * iTop is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * iTop is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License */ + Dict::Add('FR FR', 'French', 'Français', array( 'Attachments:TabTitle_Count' => 'Pièces jointes (%1$d)', 'Attachments:EmptyTabTitle' => 'Pièces jointes', @@ -66,7 +62,7 @@ Dict::Add('FR FR', 'French', 'Français', array( 'Attachments:File:Thumbnail' => 'Icône', 'Attachments:File:Name' => 'Nom du fichier', 'Attachments:File:Date' => 'Date de chargement', - 'Attachments:File:Creator' => 'Chargé par', + 'Attachments:File:Uploader' => 'Chargé par', 'Attachments:File:Size' => 'Taille', 'Attachments:File:MimeType' => 'Type', )); \ No newline at end of file diff --git a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php index 6640c67bb..868dee6b7 100644 --- a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php @@ -348,22 +348,22 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer $sFileName = Dict::S('Attachments:File:Name'); $sFileSize = Dict::S('Attachments:File:Size'); $sFileDate = Dict::S('Attachments:File:Date'); - $sFileCreator = Dict::S('Attachments:File:Creator'); + $sFileUploader = Dict::S('Attachments:File:Uploader'); $sFileType = Dict::S('Attachments:File:MimeType'); $sDeleteColumn = ''; if ($bWithDeleteButton) { - $sDeleteColumn = ''; + $sDeleteColumn = ''; } $this->oPage->add(<< - $sThumbnail - $sFileName - $sFileSize - $sFileDate - $sFileCreator - $sFileType + $sThumbnail + $sFileName + $sFileSize + $sFileDate + $sFileUploader + $sFileType $sDeleteColumn @@ -452,7 +452,8 @@ JS $sFileName = utils::HtmlEntities($oDoc->GetFileName()); $sTrId = $this->GetAttachmentContainerId($iAttachmentId); $sAttachmentMeta = $this->GetAttachmentHiddenInput($iAttachmentId, $bIsDeletedAttachment); - $sFileSize = $oDoc->GetFormattedSize(); + $sFileSize = $oDoc->GetSize(); + $sFileFormattedSize = $oDoc->GetFormattedSize(); $bIsTempAttachment = ($oAttachment->Get('item_id') === 0); $sAttachmentDate = ''; if (!$bIsTempAttachment) @@ -464,7 +465,8 @@ JS } } - $sAttachmentCreator = $oAttachment->Get('contact_id_friendlyname'); + $sAttachmentUploader = $oAttachment->Get('contact_id_friendlyname'); + $sAttachmentUploaderForHtml = utils::HtmlEntities($sAttachmentUploader); $sFileType = $oDoc->GetMimeType(); @@ -483,17 +485,17 @@ JS if ($bWithDeleteButton) { $sDeleteButton = $this->GetDeleteAttachmentButton($iAttachmentId); - $sDeleteColumn = "$sDeleteButton"; + $sDeleteColumn = "$sDeleteButton"; } $this->oPage->add(<< - - $sFileName$sAttachmentMeta - $sFileSize - $sAttachmentDate - $sAttachmentCreator - $sFileType + + + $sFileName$sAttachmentMeta + $sFileFormattedSize + $sAttachmentDate + $sAttachmentUploader + $sFileType $sDeleteColumn HTML diff --git a/datamodels/2.x/itop-attachments/zh_cn.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/zh_cn.dict.itop-attachments.php index 06f76bae6..bbd4d95f9 100644 --- a/datamodels/2.x/itop-attachments/zh_cn.dict.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/zh_cn.dict.itop-attachments.php @@ -1,9 +1,6 @@ */ Dict::Add('ZH CN', 'Chinese', '简体中文', array( @@ -66,7 +62,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array( 'Attachments:File:Thumbnail' => '图标', 'Attachments:File:Name' => '文件名', 'Attachments:File:Date' => '上传日期', - 'Attachments:File:Creator' => '上传者', + 'Attachments:File:Uploader' => '上传者', 'Attachments:File:Size' => '大小', 'Attachments:File:MimeType' => '类型', )); \ No newline at end of file diff --git a/sources/renderer/bootstrap/fieldrenderer/bsfileuploadfieldrenderer.class.inc.php b/sources/renderer/bootstrap/fieldrenderer/bsfileuploadfieldrenderer.class.inc.php index 5d882af61..6cf3466db 100644 --- a/sources/renderer/bootstrap/fieldrenderer/bsfileuploadfieldrenderer.class.inc.php +++ b/sources/renderer/bootstrap/fieldrenderer/bsfileuploadfieldrenderer.class.inc.php @@ -472,11 +472,11 @@ HTML return << - $sTitleThumbnail - $sTitleFileName - $sTitleFileSize - $sTitleFileDate - + $sTitleThumbnail + $sTitleFileName + $sTitleFileSize + $sTitleFileDate + $sDeleteHeaderAsHtml HTML; } @@ -500,20 +500,20 @@ HTML; $iAttId, $sLineStyle, $sDocDownloadUrl, $sIconClass, $sAttachmentThumbUrl, $sFileName, $sAttachmentMeta, $sFileSize, $sAttachmentDate, $bIsDeleteAllowed ) { - $sDeleteButton = ''; + $sDeleteCell = ''; if ($bIsDeleteAllowed) { $sDeleteBtnLabel = Dict::S('Portal:Button:Delete'); - $sDeleteButton = ''; + $sDeleteCell = ''; } return << - - $sFileName$sAttachmentMeta - $sFileSize - $sAttachmentDate - $sDeleteButton + + $sFileName$sAttachmentMeta + $sFileSize + $sAttachmentDate + $sDeleteCell HTML; }