Merge remote-tracking branch 'origin/support/3.0' into develop

This commit is contained in:
Molkobain
2022-02-02 11:20:58 +01:00
24 changed files with 568 additions and 62 deletions

File diff suppressed because one or more lines are too long

View File

@@ -206,7 +206,7 @@ abstract class AbstractAttachmentsRenderer
function RefreshAttachmentsDisplay(dataUpload)
{
var sContentNode = '#AttachmentsListContainer',
aAttachmentsDeletedHiddenInputs = $('table.attachmentsList>tbody>tr[id^="display_attachment_"]>td input[name="removed_attachments[]"]'),
aAttachmentsDeletedHiddenInputs = $('#AttachmentsListContainer table>tbody>tr[id^="display_attachment_"]>td input[name="removed_attachments[]"]'),
aAttachmentsDeletedIds = aAttachmentsDeletedHiddenInputs.map(function() { return $(this).val() }).toArray();
$(sContentNode).block();
$.post(GetAbsoluteUrlModulesRoot()+'itop-attachments/ajax.itop-attachment.php',
@@ -416,7 +416,6 @@ class TableDetailsAttachmentsRenderer extends AbstractAttachmentsRenderer
$sFileDate = Dict::S('Attachments:File:Date');
$sFileUploader = Dict::S('Attachments:File:Uploader');
$sFileType = Dict::S('Attachments:File:MimeType');
$sDeleteColumn = '';
if ($bWithDeleteButton)
{
@@ -488,17 +487,9 @@ JS
{
$iAttachmentId = $oAttachment->GetKey();
$sLineClass = '';
if ($bIsEven)
{
$sLineClass = 'class="even"';
}
$sLineStyle = '';
$bIsDeletedAttachment = false;
if (in_array($iAttachmentId, $aAttachmentsDeleted, true))
{
$sLineStyle = 'style="display: none;"';
$bIsDeletedAttachment = true;
}
@@ -513,7 +504,6 @@ JS
$sFileFormattedSize = $oDoc->GetFormattedSize();
$bIsTempAttachment = ($oAttachment->Get('item_id') === 0);
$sAttachmentDateFormatted = '';
$iAttachmentDateRaw = '';
if (!$bIsTempAttachment)
{
$sAttachmentDate = $oAttachment->Get('creation_date');
@@ -523,7 +513,6 @@ JS
}
$oAttachmentDate = DateTime::createFromFormat(AttributeDateTime::GetInternalFormat(), $sAttachmentDate);
$sAttachmentDateFormatted = AttributeDateTime::GetFormat()->Format($oAttachmentDate);
$iAttachmentDateRaw = AttributeDateTime::GetAsUnixSeconds($sAttachmentDate);
}
$sAttachmentUploader = $oAttachment->Get('contact_id_friendlyname');
@@ -560,7 +549,11 @@ JS
'type' => $sFileType,
'js' => '',
);
if ($bIsDeletedAttachment) {
$aAttachmentLine['@class'] = 'ibo-is-hidden';
}
if ($bWithDeleteButton)
{
$sDeleteButton = $this->GetDeleteAttachmentButton($iAttachmentId);

View File

@@ -19,6 +19,7 @@
namespace Combodo\iTop\Portal\Twig;
use AttributeDate;
use Twig\Extension\AbstractExtension;
use AttributeDateTime;
@@ -76,6 +77,10 @@ class AppExtension extends AbstractExtension
{
return AttributeDateTime::GetFormat()->Format($sDate);
}
if (preg_match('@^\d\d\d\d-\d\d-\d\d$@', trim($sDate)))
{
return AttributeDate::GetFormat()->Format($sDate);
}
}
catch (Exception $e)
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long