diff --git a/datamodels/2.x/itop-attachments/ajax.itop-attachment.php b/datamodels/2.x/itop-attachments/ajax.itop-attachment.php index e32d252d7..902922781 100644 --- a/datamodels/2.x/itop-attachments/ajax.itop-attachment.php +++ b/datamodels/2.x/itop-attachments/ajax.itop-attachment.php @@ -94,6 +94,8 @@ try $oAttachment->Set('expire', time() + MetaModel::GetConfig()->Get('draft_attachments_lifetime')); $oAttachment->Set('temp_id', $sTempId); $oAttachment->Set('item_class', $sClass); + $oAttachment->Set('creation_date', time()); + $oAttachment->Set('user_id', UserRights::GetUserObject()); $oAttachment->SetDefaultOrgId(); $oAttachment->Set('contents', $oDoc); $iAttId = $oAttachment->DBInsert(); diff --git a/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml b/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml index d91967942..95692e0d2 100755 --- a/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml +++ b/datamodels/2.x/itop-attachments/datamodel.itop-attachments.xml @@ -54,32 +54,51 @@ - - expire - - false - - - temp_id - - true - - - item_class - - false - - - item_id - true - item_class - - - item_org_id - 0 - true - - + + expire + + false + + + temp_id + + true + + + item_class + + false + + + item_id + true + item_class + + + item_org_id + 0 + true + + + + creation_date + + true + + + user_id + true + DEL_MANUAL + User + false + + + user_id + contactid + + + + @@ -216,19 +235,22 @@ - - - - 10 - - - 20 - - - 30 - - - + + + + 10 + + + 20 + + + 30 + + + 40 + + + 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 2ee120c56..286f33a9f 100755 --- a/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/en.dict.itop-attachments.php @@ -65,7 +65,8 @@ Dict::Add('EN US', 'English', 'English', array( Dict::Add('EN US', 'English', 'English', array( 'Attachments:File:Thumbnail' => 'Icon', 'Attachments:File:Name' => 'File name', - 'Attachments:File:Date' => 'Date added', + 'Attachments:File:Date' => 'Upload date', + 'Attachments:File:Creator' => '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 cfbe47c1d..047e0e870 100755 --- a/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/fr.dict.itop-attachments.php @@ -60,3 +60,13 @@ Dict::Add('FR FR', 'French', 'Français', array( 'Class:Attachment/Attribute:contents' => 'Contenu', 'Class:Attachment/Attribute:contents+' => '', )); + + +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: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 827337852..075949a85 100644 --- a/datamodels/2.x/itop-attachments/renderers.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/renderers.itop-attachments.php @@ -326,6 +326,7 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer $this->oPage->add(' '.Dict::S('Attachments:File:Name').''.PHP_EOL); $this->oPage->add(' '.Dict::S('Attachments:File:Size').''.PHP_EOL); $this->oPage->add(' '.Dict::S('Attachments:File:Date').''.PHP_EOL); + $this->oPage->add(' '.Dict::S('Attachments:File:Creator').''.PHP_EOL); $this->oPage->add(' '.Dict::S('Attachments:File:MimeType').''.PHP_EOL); if ($bWithDeleteButton) { @@ -424,7 +425,19 @@ CSS $sTrId = $this->GetAttachmentContainerId($iAttachmentId); $sAttachmentMeta = $this->GetAttachmentHiddenInput($iAttachmentId, $bIsDeletedAttachment); $sFileSize = $oDoc->GetFormatedSize(); - $sAttachmentDate = array_key_exists($iAttachmentId, $aAttachmentsDate) ? $aAttachmentsDate[$iAttachmentId] : 'N/A'; + $bIsTempAttachment = ($oAttachment->Get('item_id') === 0); + $sAttachmentDate = ''; + if (!$bIsTempAttachment) + { + $sAttachmentDate = $oAttachment->Get('creation_date'); + if (empty($sAttachmentDate) && array_key_exists($iAttachmentId, $aAttachmentsDate)) + { + $sAttachmentDate = $aAttachmentsDate[$iAttachmentId]; + } + } + + $sAttachmentCreator = $oAttachment->Get('contact_id_friendlyname'); + $sFileType = $oDoc->GetMimeType(); $sAttachmentThumbUrl = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($sFileName); @@ -451,6 +464,7 @@ CSS $sFileName$sAttachmentMeta $sFileSize $sAttachmentDate + $sAttachmentCreator $sFileType $sDeleteColumn