From 60696ac0799511dffe9ffee6271dcef816208311 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 14:23:03 +0200 Subject: [PATCH 1/6] check for attribute 'required' when creating select menu in formField() --- views/bootstrap/class.Bootstrap.php | 1 + views/bootstrap4/class.Bootstrap4.php | 1 + 2 files changed, 2 insertions(+) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 66b390c93..59b4cc525 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -1177,6 +1177,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; (!empty($value['name']) ? ' name="'.$value['name'].'"' : ''). (!empty($value['class']) ? ' class="'.$value['class'].'"' : ''). (!empty($value['placeholder']) ? ' data-placeholder="'.$value['placeholder'].'"' : ''). + (!empty($value['required']) ? ' required="required"' : ''). ($allowempty ? ' data-allow-clear="true"' : ''). (!empty($value['multiple']) ? ' multiple' : ''); if(!empty($value['attributes']) && is_array($value['attributes'])) diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 2f04ebf50..d78216d5a 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -1161,6 +1161,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; (!empty($value['name']) ? ' name="'.$value['name'].'"' : ''). (empty($value['class']) ? ' class="form-control"' : ' class="form-control '.$value['class'].'"'). (!empty($value['placeholder']) ? ' data-placeholder="'.$value['placeholder'].'"' : ''). + (!empty($value['required']) ? ' required="required"' : ''). ($allowempty ? ' data-allow-clear="true"' : ''). (!empty($value['multiple']) ? ' multiple' : ''); if(!empty($value['attributes']) && is_array($value['attributes'])) From b77609d3755c755f36ad796ce2acae1666638d03 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 14:23:42 +0200 Subject: [PATCH 2/6] comment is no longer required --- views/bootstrap/class.OverrideContentStatus.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/views/bootstrap/class.OverrideContentStatus.php b/views/bootstrap/class.OverrideContentStatus.php index 3332559ca..251c2f543 100644 --- a/views/bootstrap/class.OverrideContentStatus.php +++ b/views/bootstrap/class.OverrideContentStatus.php @@ -37,14 +37,6 @@ class SeedDMS_View_OverrideContentStatus extends SeedDMS_Theme_Style { ?> $(document).ready(function() { $("#form1").validate({ - rules: { - comment: { - required: true - }, - overrideStatus: { - required: true - }, - }, messages: { comment: "", overrideStatus: "", @@ -88,7 +80,7 @@ $(document).ready(function() { array( 'element'=>'textarea', 'name'=>'comment', - 'required'=>true, + 'required'=>false, 'rows'=>4, ) ); @@ -104,6 +96,7 @@ $(document).ready(function() { 'element'=>'select', 'name'=>'overrideStatus', 'options'=>$options, + 'required'=>true, ) ); $this->contentContainerEnd(); From bf4fe82cd5dc99b81780d67efcc230e61a8456c2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 14:24:09 +0200 Subject: [PATCH 3/6] status of previous version can be overwritten --- views/bootstrap/class.ViewDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 3874ce92d..4c4cefb31 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -820,7 +820,7 @@ $(document).ready( function() { if($accessobject->mayRemoveVersion()) { $items[] = array('link'=>$this->html_url('RemoveVersion', array('documentid'=>$latestContent->getDocument()->getId(),'version'=>$latestContent->getVersion())), 'icon'=>'remove', 'label'=>'rm_version'); } - if($islatest && $accessobject->mayOverwriteStatus()) { + if($accessobject->mayOverwriteStatus()) { $items[] = array('link'=>$this->html_url('OverrideContentStatus', array('documentid'=>$latestContent->getDocument()->getId(),'version'=>$latestContent->getVersion())), 'icon'=>'align-justify', 'label'=>'change_status'); } if($islatest) { From f2b48307306390b05ce8b98cdff6b905cd2c3b79 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 14:24:43 +0200 Subject: [PATCH 4/6] check for maxfileszise of uploaded file --- views/bootstrap/class.AddDocument.php | 4 +++- views/bootstrap/class.UpdateDocument.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index 8d16d4f14..5738709f9 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -100,7 +100,9 @@ console.log(params); } else { ?> 'userfile[]': { - require_from_group: [1, ".fileupload-group"] + require_from_group: [1, ".fileupload-group"], + maxsize: + // alternatives: $('#dropfolderfileadddocform') }, dropfolderfileadddocform: { diff --git a/views/bootstrap/class.UpdateDocument.php b/views/bootstrap/class.UpdateDocument.php index 5f8b6d1a7..ae9b7fc7a 100644 --- a/views/bootstrap/class.UpdateDocument.php +++ b/views/bootstrap/class.UpdateDocument.php @@ -96,7 +96,9 @@ $(document).ready( function() { } else { ?> userfile: { - require_from_group: [1, ".fileupload-group"] + require_from_group: [1, ".fileupload-group"], + maxsize: + // alternatives: $('#dropfolderfileform1') }, dropfolderfileform1: { From 72509a09ebb7b9f5f3b4d7b65bcde4aa48bfcb29 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 18:12:10 +0200 Subject: [PATCH 5/6] =?UTF-8?q?add=20ViewOnl=D1=96ne=20and=20Download=20to?= =?UTF-8?q?=20legacy=20access=20rights?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/inc.ClassAccessOperation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/inc.ClassAccessOperation.php b/inc/inc.ClassAccessOperation.php index 2193c6cbc..4f1e52167 100644 --- a/inc/inc.ClassAccessOperation.php +++ b/inc/inc.ClassAccessOperation.php @@ -58,12 +58,14 @@ class SeedDMS_AccessOperation { $this->settings = $settings; $this->legacy_access['guest'] = array( 'Calendar', + 'Download', 'ErrorDlg', 'Help', 'Login', 'Search', 'ViewDocument', 'ViewFolder', + 'ViewOnline', ); $this->legacy_access['user'] = array( 'AddDocument', @@ -84,6 +86,7 @@ class SeedDMS_AccessOperation { 'DocumentChooser', 'DocumentNotify', 'DocumentVersionDetail', + 'Download', 'DropFolderChooser', 'EditAttributes', 'EditComment', @@ -146,6 +149,7 @@ class SeedDMS_AccessOperation { 'ViewDocument', 'ViewEvent', 'ViewFolder', + 'ViewOnline', 'WorkflowGraph', 'WorkflowSummary'); } /* }}} */ From 188d440560349b2226d6f4e3dc3676470f81ed1d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 2 May 2024 18:12:41 +0200 Subject: [PATCH 6/6] schedule document for reindexing when changing the mimetype or name --- op/op.Ajax.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 03b024064..0432a19f1 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -626,6 +626,13 @@ switch($command) { if($notifier) { $notifier->sendChangedNameMail($document, $user, $oldname); } + if($fulltextservice && ($index = $fulltextservice->Indexer())) { + $lucenesearch = $fulltextservice->Search(); + if($hit = $lucenesearch->getDocument($document->getId())) { + $index->reindexDocument($hit->id); + $index->commit(); + } + } header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_name_changed'), 'data'=>'')); add_log_line("set name '".$_REQUEST['name']."' of document ".$document->getId()); @@ -657,6 +664,13 @@ switch($command) { header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error setting mimetype', 'data'=>'')); } else { + if($fulltextservice && ($index = $fulltextservice->Indexer())) { + $lucenesearch = $fulltextservice->Search(); + if($hit = $lucenesearch->getDocument($document->getId())) { + $index->reindexDocument($hit->id); + $index->commit(); + } + } header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>getMLText('splash_mimetype_changed'), 'data'=>'')); add_log_line("set mimetype '".$realmimetype."' of document ".$document->getId().":".$content->getVersion());