diff --git a/datamodels/2.x/itop-attachments/main.itop-attachments.php b/datamodels/2.x/itop-attachments/main.itop-attachments.php index 94a1e72699..5d50785f20 100644 --- a/datamodels/2.x/itop-attachments/main.itop-attachments.php +++ b/datamodels/2.x/itop-attachments/main.itop-attachments.php @@ -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; diff --git a/datamodels/2.x/itop-core-update/src/Controller/UpdateController.php b/datamodels/2.x/itop-core-update/src/Controller/UpdateController.php index 6f6c08eb1f..ac0b9a58e0 100644 --- a/datamodels/2.x/itop-core-update/src/Controller/UpdateController.php +++ b/datamodels/2.x/itop-core-update/src/Controller/UpdateController.php @@ -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); diff --git a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig index eb17894128..51d1cfdd72 100644 --- a/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig +++ b/datamodels/2.x/itop-core-update/templates/SelectUpdateFile.ready.js.twig @@ -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", diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index 07aedd49ab..05ca957620 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -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); } }