mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
Merge remote-tracking branch 'origin/support/3.1' into support/3.2
This commit is contained in:
@@ -267,6 +267,23 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see ObjectFormManager::FinalizeAttachments() for the portal version
|
||||
*
|
||||
* @param $oObject
|
||||
* @param $oChange
|
||||
*
|
||||
* @return void
|
||||
* @throws \ArchivedObjectException
|
||||
* @throws \CoreCannotSaveObjectException
|
||||
* @throws \CoreException
|
||||
* @throws \CoreUnexpectedValue
|
||||
* @throws \DeleteException
|
||||
* @throws \MySQLException
|
||||
* @throws \MySQLHasGoneAwayException
|
||||
* @throws \OQLException
|
||||
*/
|
||||
protected static function UpdateAttachments($oObject, $oChange = null)
|
||||
{
|
||||
self::$m_bIsModified = false;
|
||||
|
||||
@@ -45,6 +45,7 @@ class UpdateController extends Controller
|
||||
$aParams['sFileUploadMaxSize'] = utils::BytesToFriendlyFormat($aParams['iFileUploadMaxSize']);
|
||||
$aParams['sPostMaxSize'] = ini_get('post_max_size');
|
||||
$aParams['sUploadMaxSize'] = ini_get('upload_max_filesize');
|
||||
$aParams['bDontUpgradeIfIntegrityFailed'] = !utils::IsDevelopmentEnvironment();
|
||||
$oFilter = DBObjectSearch::FromOQL('SELECT ModuleInstallation WHERE parent_id=0 AND name!="datamodel"');
|
||||
$oSet = new DBObjectSet($oFilter, ['installed' => false]); // Most recent first
|
||||
$aParams['oSet'] = $oSet;
|
||||
@@ -129,7 +130,6 @@ class UpdateController extends Controller
|
||||
$sTransactionId = utils::GetNewTransactionId();
|
||||
$aParams['sTransactionId'] = $sTransactionId;
|
||||
|
||||
$this->AddSaas('css/backoffice/main.scss');
|
||||
$this->m_sOperation = 'ConfirmUpdate';
|
||||
$this->DisplaySetupPage($aParams);
|
||||
}
|
||||
@@ -158,7 +158,6 @@ class UpdateController extends Controller
|
||||
'sAjaxURL' => utils::GetAbsoluteUrlAppRoot().'/pages/UI.php',
|
||||
];
|
||||
$this->AddLinkedScript(utils::GetAbsoluteUrlAppRoot().'setup/jquery.progression.js');
|
||||
$this->AddSaas('css/backoffice/main.scss');
|
||||
$this->AddSaas('env-'.utils::GetCurrentEnvironment().'/itop-core-update/css/itop-core-update.scss');
|
||||
$this->m_sOperation = 'UpdateCoreFiles';
|
||||
$this->DisplaySetupPage($aParams);
|
||||
|
||||
@@ -28,10 +28,17 @@ $.ajax({
|
||||
$("#file-container").removeClass("ibo-is-hidden");
|
||||
$("#check-in-progress").addClass("ibo-is-hidden");
|
||||
} else {
|
||||
$("#check-update").prop("disabled", true);
|
||||
$("#file").prop("disabled", true);
|
||||
$('#form-update-outer').slideUp(600);
|
||||
oRequirements.addClass("ibo-is-failure");
|
||||
{% if bDontUpgradeIfIntegrityFailed %}
|
||||
$("#check-update").prop("disabled", true);
|
||||
$("#file").prop("disabled", true);
|
||||
$('#form-update-outer').slideUp(600);
|
||||
{% else %}
|
||||
$("#check-update").prop("disabled", false);
|
||||
$("#file").prop("disabled", false);
|
||||
$("#file-container").removeClass("ibo-is-hidden");
|
||||
$("#check-in-progress").addClass("ibo-is-hidden");
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -55,7 +62,7 @@ var oGetDBDiskSpace = $.ajax({
|
||||
method: "POST",
|
||||
url: "{{ sAjaxURL|raw }}",
|
||||
data: {
|
||||
route: "core_update_ajax.get_d_b_disk_space",
|
||||
route: "core_update_ajax.get_db_disk_space",
|
||||
maintenance: true
|
||||
},
|
||||
dataType: "json",
|
||||
|
||||
@@ -1463,6 +1463,8 @@ class ObjectFormManager extends FormManager
|
||||
// Remove attachments that are no longer attached to the current object
|
||||
if (in_array($oAttachment->GetKey(), $aRemovedAttachmentsIds))
|
||||
{
|
||||
$aData = ['attachment' => $oAttachment];
|
||||
$this->oObject->FireEvent(EVENT_REMOVE_ATTACHMENT_FROM_OBJECT, $aData);
|
||||
$oAttachment->DBDelete();
|
||||
$aActions[] = self::GetAttachmentActionChangeOp($oAttachment, false);
|
||||
}
|
||||
@@ -1487,6 +1489,8 @@ class ObjectFormManager extends FormManager
|
||||
$oAttachment->Set('temp_id', '');
|
||||
$oAttachment->DBUpdate();
|
||||
$aActions[] = self::GetAttachmentActionChangeOp($oAttachment, true);
|
||||
$aData = ['attachment' => $oAttachment];
|
||||
$this->oObject->FireEvent(EVENT_ADD_ATTACHMENT_TO_OBJECT, $aData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user