default public status of attachments can be configured

This commit is contained in:
Uwe Steinmann 2023-05-03 16:24:33 +02:00
parent 14afb5f1b7
commit 244066d34d
7 changed files with 11 additions and 2 deletions

View File

@ -12,6 +12,7 @@
- major overhaul of fulltext search, add new search tab for a more - major overhaul of fulltext search, add new search tab for a more
facetted based search facetted based search
- add initial version of Dashboard - add initial version of Dashboard
- default public status of attachments can be configured
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.30 Changes in version 5.1.30

View File

@ -122,6 +122,8 @@ class Settings { /* {{{ */
var $_proxyPassword = null; var $_proxyPassword = null;
// enable removal of file from dropfolder after success import // enable removal of file from dropfolder after success import
var $_removeFromDropFolder = false; var $_removeFromDropFolder = false;
// uploaded attachements are not public by default
var $_uploadedAttachmentIsPublic = false;
// Where the stop word file is located // Where the stop word file is located
var $_stopWordsFile = null; var $_stopWordsFile = null;
// enable/disable lucene fulltext search // enable/disable lucene fulltext search
@ -740,6 +742,7 @@ class Settings { /* {{{ */
$this->_enableDuplicateSubFolderNames = Settings::boolval($tab["enableDuplicateSubFolderNames"]); $this->_enableDuplicateSubFolderNames = Settings::boolval($tab["enableDuplicateSubFolderNames"]);
$this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]); $this->_overrideMimeType = Settings::boolval($tab["overrideMimeType"]);
$this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]); $this->_removeFromDropFolder = Settings::boolval($tab["removeFromDropFolder"]);
$this->_uploadedAttachmentIsPublic = Settings::boolval($tab["uploadedAttachmentIsPublic"]);
} }
// XML Path: /configuration/advanced/notification // XML Path: /configuration/advanced/notification
@ -1087,6 +1090,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames); $this->setXMLAttributValue($node, "enableDuplicateSubFolderNames", $this->_enableDuplicateSubFolderNames);
$this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType); $this->setXMLAttributValue($node, "overrideMimeType", $this->_overrideMimeType);
$this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder); $this->setXMLAttributValue($node, "removeFromDropFolder", $this->_removeFromDropFolder);
$this->setXMLAttributValue($node, "uploadedAttachmentIsPublic", $this->_uploadedAttachmentIsPublic);
// XML Path: /configuration/advanced/notification // XML Path: /configuration/advanced/notification
$node = $this->getXMLNode($xml, '/configuration/advanced', 'notification'); $node = $this->getXMLNode($xml, '/configuration/advanced', 'notification');

View File

@ -927,7 +927,7 @@ switch($command) {
$name = utf8_basename($userfilename); $name = utf8_basename($userfilename);
$comment = ''; $comment = '';
$version = 0; $version = 0;
$public = false; $public = $settings->_uploadedAttachmentIsPublic;
$res = $document->addDocumentFile($name, $comment, $user, $userfiletmp, $res = $document->addDocumentFile($name, $comment, $user, $userfiletmp,
utf8_basename($userfilename),$fileType, $userfiletype, $version, $public); utf8_basename($userfilename),$fileType, $userfiletype, $version, $public);
if (is_bool($res) && !$res) { if (is_bool($res) && !$res) {

View File

@ -253,6 +253,7 @@ if ($action == "saveSettings")
setBoolValue("enableDuplicateSubFolderNames"); setBoolValue("enableDuplicateSubFolderNames");
setBoolValue("overrideMimeType"); setBoolValue("overrideMimeType");
setBoolValue("removeFromDropFolder"); setBoolValue("removeFromDropFolder");
setBoolValue("uploadedAttachmentIsPublic");
// SETTINGS - ADVANCED - NOTIFICATION // SETTINGS - ADVANCED - NOTIFICATION
setBoolValue("enableOwnerNotification"); setBoolValue("enableOwnerNotification");

View File

@ -55,6 +55,7 @@ if($view) {
$view->setParam('document', $document); $view->setParam('document', $document);
$view->setParam('strictformcheck', $settings->_strictFormCheck); $view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload); $view->setParam('enablelargefileupload', $settings->_enableLargeFileUpload);
$view->setParam('uploadedattachmentispublic', $settings->_uploadedAttachmentIsPublic);
$view->setParam('accessobject', $accessop); $view->setParam('accessobject', $accessop);
$view($_GET); $view($_GET);
exit; exit;

View File

@ -111,6 +111,7 @@ $(document).ready( function() {
$document = $this->params['document']; $document = $this->params['document'];
$strictformcheck = $this->params['strictformcheck']; $strictformcheck = $this->params['strictformcheck'];
$enablelargefileupload = $this->params['enablelargefileupload']; $enablelargefileupload = $this->params['enablelargefileupload'];
$uploadedattachmentispublic = $this->params['uploadedattachmentispublic'];
$maxuploadsize = $this->params['maxuploadsize']; $maxuploadsize = $this->params['maxuploadsize'];
$this->htmlAddHeader('<script type="text/javascript" src="'.$this->params['settings']->_httpRoot.'views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js'); $this->htmlAddHeader('<script type="text/javascript" src="'.$this->params['settings']->_httpRoot.'views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
@ -183,7 +184,7 @@ $(document).ready( function() {
'id'=>'public', 'id'=>'public',
'name'=>'public', 'name'=>'public',
'value'=>'true', 'value'=>'true',
'checked'=>true, 'checked'=>$uploadedattachmentispublic,
) )
); );
} }

View File

@ -515,6 +515,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigCheckbox('settings_enableDuplicateSubFolderNames', 'enableDuplicateSubFolderNames'); ?> <?php $this->showConfigCheckbox('settings_enableDuplicateSubFolderNames', 'enableDuplicateSubFolderNames'); ?>
<?php $this->showConfigCheckbox('settings_overrideMimeType', 'overrideMimeType'); ?> <?php $this->showConfigCheckbox('settings_overrideMimeType', 'overrideMimeType'); ?>
<?php $this->showConfigCheckbox('settings_removeFromDropFolder', 'removeFromDropFolder'); ?> <?php $this->showConfigCheckbox('settings_removeFromDropFolder', 'removeFromDropFolder'); ?>
<?php $this->showConfigCheckbox('settings_uploadedAttachmentIsPublic', 'uploadedAttachmentIsPublic'); ?>
<!-- <!--
-- SETTINGS - ADVANCED - NOTIFICATION -- SETTINGS - ADVANCED - NOTIFICATION