tasks and clipboard can be shown in main menu, even if there are no tasks due or the clipboard is empty

This commit is contained in:
Uwe Steinmann 2024-04-15 17:37:20 +02:00
parent f79c60e927
commit c411505701
6 changed files with 27 additions and 9 deletions

View File

@ -18,6 +18,8 @@
- do not list document/folders in sequence selector if its number exceeds 50
- typeahead menu works with arrow keys again, wait 1 sec. before searching
- fix sending notification mails when document/folder was moved
- tasks and clipboard can be shown in main menu, even if there are no tasks
due or the clipboard is empty
--------------------------------------------------------------------------------
Changes in version 5.1.33

View File

@ -253,8 +253,12 @@ class Settings { /* {{{ */
var $_enableExtensionImportFromRepository = true;
// enable/disable display of the clipboard
var $_enableClipboard = true;
// show always clipboard in main menu, even if empty
var $_alwaysShowClipboard = false;
// enable/disable list of tasks in main menu
var $_enableMenuTasks = true;
// show always tasks in main menu, even if none are due
var $_alwaysShowMenuTasks = true;
// enable/disable list of files in drop folder
var $_enableDropFolderList = false;
// enable/disable display of the session list
@ -546,7 +550,9 @@ class Settings { /* {{{ */
$this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]);
$this->_enableSessionList = Settings::boolVal($tab["enableSessionList"]);
$this->_enableClipboard = Settings::boolVal($tab["enableClipboard"]);
$this->_alwaysShowClipboard = Settings::boolVal($tab["alwaysShowClipboard"]);
$this->_enableMenuTasks = Settings::boolVal($tab["enableMenuTasks"]);
$this->_alwaysShowMenuTasks = Settings::boolVal($tab["alwaysShowMenuTasks"]);
$this->_enableDropFolderList = Settings::boolVal($tab["enableDropFolderList"]);
$this->_enableDropUpload = Settings::boolVal($tab["enableDropUpload"]);
$this->_enableMultiUpload = Settings::boolVal($tab["enableMultiUpload"]);
@ -947,7 +953,9 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableUsersView", $this->_enableUsersView);
$this->setXMLAttributValue($node, "enableSessionList", $this->_enableSessionList);
$this->setXMLAttributValue($node, "enableClipboard", $this->_enableClipboard);
$this->setXMLAttributValue($node, "alwaysShowClipboard", $this->_alwaysShowClipboard);
$this->setXMLAttributValue($node, "enableMenuTasks", $this->_enableMenuTasks);
$this->setXMLAttributValue($node, "alwaysShowMenuTasks", $this->_alwaysShowMenuTasks);
$this->setXMLAttributValue($node, "enableDropFolderList", $this->_enableDropFolderList);
$this->setXMLAttributValue($node, "enableDropUpload", $this->_enableDropUpload);
$this->setXMLAttributValue($node, "enableMultiUpload", $this->_enableMultiUpload);

View File

@ -137,7 +137,9 @@ if ($action == "saveSettings")
setBoolValue("showSingleSearchHit");
setBoolValue("enableSessionList");
setBoolValue("enableClipboard");
setBoolValue("alwaysShowClipboard");
setBoolValue("enableMenuTasks");
setBoolValue("alwaysShowMenuTasks");
setBoolValue("enableDropFolderList");
setBoolValue("enableDropUpload");
setBoolValue("enableMultiUpload");

View File

@ -41,8 +41,9 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style {
* @return string html code
*/
public function menuClipboard() { /* {{{ */
$settings = $this->params['settings'];
$clipboard = $this->params['session']->getClipboard();
if (/*$this->params['user']->isGuest() ||*/ (count($clipboard['docs']) + count($clipboard['folders'])) == 0) {
if (empty($settings->_alwaysShowClipboard) && (count($clipboard['docs']) + count($clipboard['folders'])) == 0) {
return '';
}
@ -58,13 +59,15 @@ class SeedDMS_View_Clipboard extends SeedDMS_Theme_Style {
if($document = $this->params['dms']->getDocument($docid))
$subitems[] = array('label'=>'<i class="fa fa-file"></i> '.$document->getName(), 'link'=>$this->params['settings']->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(), 'class'=>"table-row-document droptarget", 'attributes'=>array(array('data-droptarget', "document_".$document->getID()), array('rel', "document_".$document->getID()), array('formtoken', createFormKey('')), array('data-name', htmlspecialchars($document->getName(), ENT_QUOTES))));
}
$subitems[] = array('divider'=>true);
if(isset($this->params['folder']) && $this->params['folder']->getAccessMode($this->params['user']) >= M_READWRITE) {
$subitems[] = array('label'=>getMLText("move_clipboard"), 'link'=>$this->params['settings']->_httpRoot."op/op.MoveClipboard.php?targetid=".$this->params['folder']->getID()."&refferer=".urlencode($this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$this->params['folder']->getID()));
if((count($clipboard['docs']) + count($clipboard['folders'])) > 0) {
$subitems[] = array('divider'=>true);
if(isset($this->params['folder']) && $this->params['folder']->getAccessMode($this->params['user']) >= M_READWRITE) {
$subitems[] = array('label'=>getMLText("move_clipboard"), 'link'=>$this->params['settings']->_httpRoot."op/op.MoveClipboard.php?targetid=".$this->params['folder']->getID()."&refferer=".urlencode($this->params['settings']->_httpRoot.'out/out.ViewFolder.php?folderid='.$this->params['folder']->getID()));
}
$subitems[] = array('label'=>getMLText('clear_clipboard'), 'class'=>'ajax-click', 'attributes'=>array(array('data-href', $this->params['settings']->_httpRoot.'op/op.Ajax.php'), array('data-param1', 'command=clearclipboard')));
if($this->hasHook('clipboardMenuItems'))
$subitems = $this->callHook('clipboardMenuItems', $clipboard, $subitems);
}
$subitems[] = array('label'=>getMLText('clear_clipboard'), 'class'=>'ajax-click', 'attributes'=>array(array('data-href', $this->params['settings']->_httpRoot.'op/op.Ajax.php'), array('data-param1', 'command=clearclipboard')));
if($this->hasHook('clipboardMenuItems'))
$subitems = $this->callHook('clipboardMenuItems', $clipboard, $subitems);
$menuitems['clipboard'] = array('label'=>getMLText('clipboard')." (".count($clipboard['folders'])."/". count($clipboard['docs']).")", 'children'=>$subitems);
self::showNavigationBar($menuitems, array('right'=>true));
} /* }}} */

View File

@ -406,7 +406,9 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigOption('settings_suggestTerms', 'suggestTerms', array('title','comment', 'keywords', 'content'), true, true); ?>
<?php $this->showConfigText('settings_stopWordsFile', 'stopWordsFile'); ?>
<?php $this->showConfigCheckbox('settings_enableClipboard', 'enableClipboard'); ?>
<?php $this->showConfigCheckbox('settings_alwaysShowClipboard', 'alwaysShowClipboard'); ?>
<?php $this->showConfigCheckbox('settings_enableMenuTasks', 'enableMenuTasks'); ?>
<?php $this->showConfigCheckbox('settings_alwaysShowMenuTasks', 'alwaysShowMenuTasks'); ?>
<?php $this->showConfigCheckbox('settings_enableDropFolderList', 'enableDropFolderList'); ?>
<?php $this->showConfigCheckbox('settings_enableSessionList', 'enableSessionList'); ?>
<?php $this->showConfigCheckbox('settings_enableDropUpload', 'enableDropUpload'); ?>

View File

@ -146,6 +146,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
function menuTasks() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
if(!$tasks = $this->__myTasks()) {
echo '';
@ -167,7 +168,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
$menuitems['tasks'] = array('label'=>getMLText('tasks')." (".implode('/', $ct).")");
$menuitems['tasks']['children'] = [];
if(!empty($tasks['review']) || !empty($tasks['approval']) || !empty($tasks['workflow'])) {
if(!empty($settings->_alwaysShowMenuTasks) || !empty($tasks['review']) || !empty($tasks['approval']) || !empty($tasks['workflow'])) {
if(!empty($tasks['review'])) {
$subitems = [];
foreach($tasks['review'] as $t) {
@ -203,8 +204,8 @@ class SeedDMS_View_Tasks extends SeedDMS_Theme_Style {
}
$menuitems['tasks']['children']['divider'] = array('divider'=>true);
$menuitems['tasks']['children']['mydocuments'] = array('label'=>getMLText('my_documents'), 'link'=>$this->params['settings']->_httpRoot.'out/out.MyDocuments.php');
}
self::showNavigationBar($menuitems, array('right'=>true));
}
} /* }}} */
/**