From f679697a68b0dcf32a5dafff0edee75c7145e2e2 Mon Sep 17 00:00:00 2001 From: kevin_fourie Date: Thu, 18 Sep 2008 14:06:19 +0000 Subject: [PATCH] Merged in from STABLE trunk... --- plugins/ktcore/document/edit.php | 27 ++++++++++++++++----------- sql/mysql/install/data.sql | 3 ++- sql/mysql/upgrade/3.5.3/length_config_setting.sql | 7 +++++-- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/plugins/ktcore/document/edit.php b/plugins/ktcore/document/edit.php index 995e61b..bdbc540 100644 --- a/plugins/ktcore/document/edit.php +++ b/plugins/ktcore/document/edit.php @@ -5,31 +5,31 @@ * Document Management Made Simple * Copyright (C) 2008 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -200,11 +200,16 @@ class KTDocumentEditAction extends KTDocumentAction { $this->oDocument->setDocumentTypeId($doctypeid); } $this->oDocument->setName(($data['document_title'])); - $this->oDocument->startNewContentVersion($this->oUser); - $this->oDocument->setMinorVersionNumber($this->oDocument->getMinorVersionNumber()+1); $this->oDocument->setLastModifiedDate(getCurrentDateTime()); $this->oDocument->setModifiedUserId($this->oUser->getId()); + // Update the content version / document version + global $default; + if($default->updateContentVersion){ + $this->oDocument->startNewContentVersion($this->oUser); + $this->oDocument->setMinorVersionNumber($this->oDocument->getMinorVersionNumber()+1); + } + $res = $this->oDocument->update(); if (PEAR::isError($res)) { $oForm->handleError(sprintf(_kt("Unexpected failure to update document title: %s"), $res->getMessage())); diff --git a/sql/mysql/install/data.sql b/sql/mysql/install/data.sql index 284d445..e215509 100644 --- a/sql/mysql/install/data.sql +++ b/sql/mysql/install/data.sql @@ -272,7 +272,8 @@ INSERT INTO `config_settings` VALUES (98, 'ldapAuthentication', 'Create Groups Automatically', 'Defines whether to allow LDAP groups to be created automatically. Default is \'False\'.', 'autoGroupCreation', 'default', 'false', 'boolean', 'string', 1), (99, 'browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the browse view.', 'titleCharLength', 'default', '40', 'numeric_string', 'string', 1), (100, 'import', 'Disable Bulk Import', 'Disable the bulk import plugin', 'disableBulkImport', 'default', 'false', 'string', NULL, 1), -(101, 'session', 'Enable version check', 'Compares the system version with the database version to determine if a database upgrade is needed.','dbversioncompare', 'default', 'true', 'boolean', NULL, 0); +(101, 'session', 'Enable version check', 'Compares the system version with the database version to determine if a database upgrade is needed.','dbversioncompare', 'default', 'true', 'boolean', NULL, 0), +(102, 'tweaks', 'Update Document Version (Content) on Editing Metadata', 'The document version is equivalent to the document content version. When set to true the document version will be increased when the document metadata is updated.', 'updateContentVersion', 'default', 'false', 'boolean', NULL, 1); /*!40000 ALTER TABLE `config_settings` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/mysql/upgrade/3.5.3/length_config_setting.sql b/sql/mysql/upgrade/3.5.3/length_config_setting.sql index e19da0d..a06683f 100644 --- a/sql/mysql/upgrade/3.5.3/length_config_setting.sql +++ b/sql/mysql/upgrade/3.5.3/length_config_setting.sql @@ -1,9 +1,12 @@ INSERT INTO `config_settings` (group_name, display_name, description, item, value, default_value, type, options, can_edit) VALUES ('browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the -browse view.', 'titleCharLength', 'default', '40', 'numeric_string', '', 1), +browse view.', 'titleCharLength', 'default', '40', 'numeric_string', NULL, 1), ('import', 'Disable Bulk Import', 'Disable the bulk import plugin', 'disableBulkImport', 'default', 'false', 'string', NULL, 1), ('session', 'Enable version check', 'Compares the system version with the database version to determine if a database upgrade is needed.', -'dbversioncompare', 'default', 'true', 'boolean', NULL, 0); \ No newline at end of file +'dbversioncompare', 'default', 'true', 'boolean', NULL, 0), + +('tweaks', 'Update Document Version (Content) on Editing Metadata', 'The document version is equivalent to the document content version. When set to +true the document version will be increased when the document metadata is updated.', 'updateContentVersion', 'default', 'false', 'boolean', NULL, 1); \ No newline at end of file -- libgit2 0.21.4