From 52868d85551e8e947f3ce0a1ebd7061e45d87a54 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 30 Jan 2026 12:45:16 +0100 Subject: [PATCH] manually change document status from 'draft' to 'released' if allowed in configuration --- CHANGELOG | 2 ++ inc/inc.ClassSettings.php | 4 ++++ op/op.Settings.php | 1 + views/bootstrap/class.OverrideContentStatus.php | 3 +++ views/bootstrap/class.Settings.php | 1 + 5 files changed, 11 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 045181db9..e501b8b72 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,8 @@ - fix error when creating a new document list with a name used by another user - reception of document can be deleted to enforce a new reception - fully support 'Enable hidden users in reception list' +- manually change document status from 'draft' to 'released' if allowed + in configuration -------------------------------------------------------------------------------- Changes in version 6.0.37 diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index b8afbd3f3..0a0feda42 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -262,6 +262,8 @@ class Settings { /* {{{ */ var $_presetExpirationDate = ""; // initial document status var $_initialDocumentStatus = 2; //S_RELEASED; + // allow manually setting status from draft to release + var $_allowDraftToRelease = false; // the name of the versioning info file created by the backup tool var $_versioningFileName = "versioning_info.txt"; // the mode of workflow @@ -897,6 +899,7 @@ class Settings { /* {{{ */ $this->_globalGroupApprover = explode(',',strval($tab["globalGroupApprover"])); $this->_presetExpirationDate = strval($tab["presetExpirationDate"]); $this->_initialDocumentStatus = intval($tab["initialDocumentStatus"]); + $this->_allowDraftToRelease = Settings::boolval($tab["allowDraftToRelease"]); $this->_versioningFileName = strval($tab["versioningFileName"]); $this->_workflowMode = strval($tab["workflowMode"]); $this->_enableReceiptWorkflow = Settings::boolval($tab["enableReceiptWorkflow"]); @@ -1288,6 +1291,7 @@ class Settings { /* {{{ */ $this->setXMLAttributValue($node, "enableFilterReceipt", $this->_enableFilterReceipt); $this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate); $this->setXMLAttributValue($node, "initialDocumentStatus", $this->_initialDocumentStatus); + $this->setXMLAttributValue($node, "allowDraftToRelease", $this->_allowDraftToRelease); $this->setXMLAttributValue($node, "addManagerAsReviewer", $this->_addManagerAsReviewer); $this->setXMLAttributValue($node, "addManagerAsApprover", $this->_addManagerAsApprover); $this->setXMLAttributValue($node, "globalReviewer", implode(',', $this->_globalReviewer)); diff --git a/op/op.Settings.php b/op/op.Settings.php index 552c677e5..681530497 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -257,6 +257,7 @@ if ($action == "saveSettings") setStrValue("versioningFileName"); setStrValue("presetExpirationDate"); setStrValue("initialDocumentStatus"); + setBoolValue("allowDraftToRelease"); setStrValue("workflowMode"); setBoolValue("enableReceiptWorkflow"); setBoolValue("enableReceiptReject"); diff --git a/views/bootstrap/class.OverrideContentStatus.php b/views/bootstrap/class.OverrideContentStatus.php index 399dd762b..dc39cf2a2 100644 --- a/views/bootstrap/class.OverrideContentStatus.php +++ b/views/bootstrap/class.OverrideContentStatus.php @@ -49,6 +49,7 @@ $(document).ready(function() { function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; + $settings = $this->params['settings']; $folder = $this->params['folder']; $document = $this->params['document']; $content = $this->params['version']; @@ -92,6 +93,8 @@ $(document).ready(function() { $options[] = array(S_OBSOLETE, getOverallStatusText(S_OBSOLETE)); if ($overallStatus["status"] != S_DRAFT) $options[] = array(S_DRAFT, getOverallStatusText(S_DRAFT)); + if ($settings->_allowDraftToRelease && $overallStatus["status"] == S_DRAFT) + $options[] = array(S_RELEASED, getOverallStatusText(S_RELEASED)); if ($overallStatus["status"] != S_NEEDS_CORRECTION) $options[] = array(S_NEEDS_CORRECTION, getOverallStatusText(S_NEEDS_CORRECTION)); $this->formField( diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 9797a59f1..6df14449e 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -853,6 +853,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk)) showConfigText('settings_versioningFileName', 'versioningFileName'); ?> showConfigText('settings_presetExpirationDate', 'presetExpirationDate'); ?> showConfigOption('settings_initialDocumentStatus', 'initialDocumentStatus', array(' '.S_RELEASED=>'settings_initialDocumentStatus_released', ' '.S_DRAFT=>'settings_initialDocumentStatus_draft'), false, true); ?> +showConfigCheckbox('settings_allowDraftToRelease', 'allowDraftToRelease'); ?> showConfigCheckbox('settings_allowReviewerOnly', 'allowReviewerOnly'); ?> showConfigCheckbox('settings_allowChangeRevAppInProcess', 'allowChangeRevAppInProcess'); ?> showConfigCheckbox('settings_enableAdminRevApp', 'enableAdminRevApp'); ?>