diff --git a/CHANGELOG b/CHANGELOG index 08b520c5d..9ad0b69c8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index b0fa9da5e..65ab8784c 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -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); diff --git a/op/op.Settings.php b/op/op.Settings.php index 1ac008924..5950ccc47 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -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"); diff --git a/views/bootstrap/class.Clipboard.php b/views/bootstrap/class.Clipboard.php index 3b75db496..cce60ab47 100644 --- a/views/bootstrap/class.Clipboard.php +++ b/views/bootstrap/class.Clipboard.php @@ -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'=>' '.$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)); } /* }}} */ diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 10e8b763d..708d8fdea 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -406,7 +406,9 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk)) showConfigOption('settings_suggestTerms', 'suggestTerms', array('title','comment', 'keywords', 'content'), true, true); ?> showConfigText('settings_stopWordsFile', 'stopWordsFile'); ?> showConfigCheckbox('settings_enableClipboard', 'enableClipboard'); ?> +showConfigCheckbox('settings_alwaysShowClipboard', 'alwaysShowClipboard'); ?> showConfigCheckbox('settings_enableMenuTasks', 'enableMenuTasks'); ?> +showConfigCheckbox('settings_alwaysShowMenuTasks', 'alwaysShowMenuTasks'); ?> showConfigCheckbox('settings_enableDropFolderList', 'enableDropFolderList'); ?> showConfigCheckbox('settings_enableSessionList', 'enableSessionList'); ?> showConfigCheckbox('settings_enableDropUpload', 'enableDropUpload'); ?> diff --git a/views/bootstrap/class.Tasks.php b/views/bootstrap/class.Tasks.php index ee111f4a3..05887b94c 100644 --- a/views/bootstrap/class.Tasks.php +++ b/views/bootstrap/class.Tasks.php @@ -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)); + } } /* }}} */ /**