diff --git a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini index 191889e2..4d4bb101 100644 --- a/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-GB/com_mokosuitebackup.ini @@ -349,6 +349,8 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_ANYWAY="Continue without backup" COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard" COM_MOKOJOOMBACKUP_RUNBACKUP_VIEW_RECORD="View backup record" COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it." +COM_MOKOJOOMBACKUP_RUNBACKUP_AUTOCONTINUE="Automatically continue the update when the backup finishes" +COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)" diff --git a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini index d344d799..7f32636b 100644 --- a/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini +++ b/source/packages/com_mokosuitebackup/language/en-US/com_mokosuitebackup.ini @@ -71,6 +71,8 @@ COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_ANYWAY="Continue without backup" COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD="Back to dashboard" COM_MOKOJOOMBACKUP_RUNBACKUP_VIEW_RECORD="View backup record" COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING="A backup is in progress. Leaving now will cancel it." +COM_MOKOJOOMBACKUP_RUNBACKUP_AUTOCONTINUE="Automatically continue the update when the backup finishes" +COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE="Continue the update" COM_MOKOJOOMBACKUP_CONFIG_CLEANUP="Cleanup Defaults" COM_MOKOJOOMBACKUP_CONFIG_MAX_AGE="Max Backup Age (days)" diff --git a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php index b3c7c9ae..6b2f0a3d 100644 --- a/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php +++ b/source/packages/com_mokosuitebackup/tmpl/runbackup/default.php @@ -86,6 +86,7 @@ $config = [ 'dashboard' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_BACK_TO_DASHBOARD'), 'viewRecord' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_VIEW_RECORD'), 'leaveWarn' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_LEAVE_WARNING'), + 'continueUpdate' => Text::_('COM_MOKOJOOMBACKUP_RUNBACKUP_CONTINUE_UPDATE'), ], ]; @@ -117,7 +118,17 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku

-
+
+ + + +
+ + +
+
@@ -153,7 +164,9 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku retry: document.getElementById('msb-rb-retry'), record: document.getElementById('msb-rb-record'), continue: document.getElementById('msb-rb-continue'), - dashboard: document.getElementById('msb-rb-dashboard') + dashboard: document.getElementById('msb-rb-dashboard'), + autocontinue: document.getElementById('msb-rb-autocontinue'), + autocontinueWrap: document.getElementById('msb-rb-autocontinue-wrap') }; function setBar(pct, striped) { @@ -199,10 +212,30 @@ $this->getDocument()->addStyleSheet(Uri::root(true) . '/media/com_mokosuitebacku try { await post({ task: 'ajax.preupdateAck', action: CFG.action || '' }); } catch (e) {} if (CFG.returnUrl) { - /* Pre-update / pre-uninstall flow: continue the original action. - No "view record" button here — we're handing back to Joomla. */ - setStatus(L.continuing || 'Continuing…'); - window.setTimeout(function () { window.location.href = CFG.returnUrl; }, 1200); + /* Pre-update / pre-uninstall flow. If "auto-continue" is ticked + (default) hand back to Joomla automatically; otherwise stop here + and offer a link to the new backup record plus a manual + "Continue the update" button. */ + if (el.autocontinueWrap) { el.autocontinueWrap.classList.add('d-none'); } + + var autoContinue = !el.autocontinue || el.autocontinue.checked; + + if (autoContinue) { + setStatus(L.continuing || 'Continuing…'); + window.setTimeout(function () { window.location.href = CFG.returnUrl; }, 1200); + } else { + setStatus(L.complete || 'Backup complete'); + showActions(); + + if (lastRecordId > 0 && CFG.recordUrl) { + showBtn(el.record, L.viewRecord || 'View backup record', + CFG.recordUrl.replace('__MSBID__', String(lastRecordId))); + } + + el.continue.classList.remove('btn-warning'); + el.continue.classList.add('btn-success'); + showBtn(el.continue, L.continueUpdate || 'Continue the update', CFG.returnUrl); + } } else { /* Manual "Backup Now": offer to view the record that was just made. */ setStatus(L.complete || 'Backup complete');