add menu tasks including checkbox in settings for enabling it

This commit is contained in:
Uwe Steinmann 2017-05-12 18:09:53 +02:00
parent 440c7032f0
commit b406d31ea0
7 changed files with 50 additions and 2 deletions

View File

@ -27,6 +27,8 @@
SeedDMS_Core_DMS::filterDocumentFiles() returns also documents which are not public
if the owner tries to access them
Check return value of onPreRemove[Document|Folder], return from calling method if bool
Add SeedDMS_Core_DMS::getDocumentList()
Limit number of duplicate files to 1000
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">

View File

@ -178,6 +178,8 @@ class Settings { /* {{{ */
var $_firstDayOfWeek = 0;
// enable/disable display of the clipboard
var $_enableClipboard = true;
// enable/disable list of tasks in main menu
var $_enableMenuTasks = true;
// enable/disable display of the session list
var $_enableSessionList = false;
// enable/disable display of the drop zone for file upload
@ -416,6 +418,7 @@ class Settings { /* {{{ */
$this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]);
$this->_enableSessionList = Settings::boolVal($tab["enableSessionList"]);
$this->_enableClipboard = Settings::boolVal($tab["enableClipboard"]);
$this->_enableMenuTasks = Settings::boolVal($tab["enableMenuTasks"]);
$this->_enableDropUpload = Settings::boolVal($tab["enableDropUpload"]);
$this->_enableMultiUpload = Settings::boolVal($tab["enableMultiUpload"]);
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
@ -725,6 +728,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableUsersView", $this->_enableUsersView);
$this->setXMLAttributValue($node, "enableSessionList", $this->_enableSessionList);
$this->setXMLAttributValue($node, "enableClipboard", $this->_enableClipboard);
$this->setXMLAttributValue($node, "enableMenuTasks", $this->_enableMenuTasks);
$this->setXMLAttributValue($node, "enableDropUpload", $this->_enableDropUpload);
$this->setXMLAttributValue($node, "enableMultiUpload", $this->_enableMultiUpload);
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
@ -852,7 +856,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "smtpPassword", $this->_smtpPassword);
// XML Path: /configuration/advanced/display
$this->getXMLNode($xml, '/configuration', 'advanced');
$advnode = $this->getXMLNode($xml, '/configuration', 'advanced');
$node = $this->getXMLNode($xml, '/configuration/advanced', 'display');
$this->setXMLAttributValue($node, "siteDefaultPage", $this->_siteDefaultPage);
$this->setXMLAttributValue($node, "rootFolderID", $this->_rootFolderID);

View File

@ -104,6 +104,7 @@ class UI extends UI_Default {
$view->setParam('enablefoldertree', $settings->_enableFolderTree);
$view->setParam('enablelanguageselector', $settings->_enableLanguageSelector);
$view->setParam('enableclipboard', $settings->_enableClipboard);
$view->setParam('enablemenutasks', $settings->_enableMenuTasks);
$view->setParam('enablesessionlist', $settings->_enableSessionList);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('partitionsize', (int) $settings->_partitionSize);

View File

@ -83,6 +83,7 @@ if ($action == "saveSettings")
$settings->_showSingleSearchHit = getBoolValue("showSingleSearchHit");
$settings->_enableSessionList = getBoolValue("enableSessionList");
$settings->_enableClipboard = getBoolValue("enableClipboard");
$settings->_enableMenuTasks = getBoolValue("enableMenuTasks");
$settings->_enableDropUpload = getBoolValue("enableDropUpload");
$settings->_enableMultiUpload = getBoolValue("enableMultiUpload");
$settings->_enableFolderTree = getBoolValue("enableFolderTree");

View File

@ -1015,3 +1015,25 @@ $(document).ready(function() { /* {{{ */
$(this).parent().hide();
});
}); /* }}} */
var approval_count, review_count, receipt_count, revision_count;
var checkTasks = function() {
$.ajax({url: '../out/out.Tasks.php',
type: 'GET',
dataType: "json",
data: {action: 'mytasks'},
success: function(data) {
if(data) {
if(approval_count != data.data.approval.length ||
review_count != data.data.review.length) {
$("#menu-tasks > ul > li").html('Loading').hide().load('../out/out.Tasks.php?action=menutasks').fadeIn('500')
approval_count = data.data.approval.length;
review_count = data.data.review.length;
}
}
},
timeout: 3000
});
timeOutId = setTimeout(checkTasks, 30000);
}

View File

@ -145,6 +145,9 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo '<script src="../styles/'.$this->theme.'/chosen/js/chosen.jquery.min.js"></script>'."\n";
echo '<script src="../styles/'.$this->theme.'/select2/js/select2.min.js"></script>'."\n";
echo '<script src="../styles/'.$this->theme.'/application.js"></script>'."\n";
if(isset($this->params['user']) && $this->params['user']) {
$this->addFooterJS('checkTasks();');
}
if($this->footerjs) {
$jscode = "$(document).ready(function () {\n";
foreach($this->footerjs as $script) {
@ -305,6 +308,17 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo " </li>\n";
echo " </ul>\n";
if($this->params['enablemenutasks']) {
echo " <div id=\"menu-tasks\">";
echo " <ul id=\"main-menu-tasks\" class=\"nav pull-right\">\n";
echo " <li class=\"dropdown\">\n";
// echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array()));
echo " </li>\n";
echo " </ul>\n";
echo " </div>";
//$this->addFooterJS('checkTasks();');
}
if($this->params['enablesessionlist']) {
echo " <div id=\"menu-session\">";
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Session\" data-action=\"menuSessions\"></div>";
@ -1525,7 +1539,7 @@ $(function() {
function printDeleteDocumentButton($document, $msg, $return=false){ /* {{{ */
$docid = $document->getID();
$content = '';
$content .= '<a class="delete-document-btn" rel="'.$docid.'" msg="'.getMLText($msg).'"confirmmsg="'.htmlspecialchars(getMLText("confirm_rm_document", array ("documentname" => $document->getName())), ENT_QUOTES).'"><i class="icon-remove"></i></a>';
$content .= '<a class="delete-document-btn" rel="'.$docid.'" msg="'.getMLText($msg).'" confirmmsg="'.htmlspecialchars(getMLText("confirm_rm_document", array ("documentname" => $document->getName())), ENT_QUOTES).'"><i class="icon-remove"></i></a>';
if($return)
return $content;
else

View File

@ -265,6 +265,10 @@ if(!is_writeable($settings->_configFilePath)) {
<tr title="<?php printMLText("settings_enableClipboard_desc");?>">
<td><?php printMLText("settings_enableClipboard");?>:</td>
<td><input name="enableClipboard" type="checkbox" <?php if ($settings->_enableClipboard) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableMenuTasks_desc");?>">
<td><?php printMLText("settings_enableMenuTasks");?>:</td>
<td><input name="enableMenuTasks" type="checkbox" <?php if ($settings->_enableMenuTasks) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableSessionList_desc");?>">
<td><?php printMLText("settings_enableSessionList");?>:</td>