mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
c0215ffef3
|
@ -32,6 +32,7 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
|
||||||
|
|
||||||
if($view) {
|
if($view) {
|
||||||
|
$view->setParam('workflowmode', $settings->_workflowMode);
|
||||||
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
||||||
$view->setParam('timeout', $settings->_cmdTimeout);
|
$view->setParam('timeout', $settings->_cmdTimeout);
|
||||||
$view($_GET);
|
$view($_GET);
|
||||||
|
|
|
@ -1003,7 +1003,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
});
|
});
|
||||||
}); /* }}} */
|
}); /* }}} */
|
||||||
|
|
||||||
var approval_count, review_count, receipt_count, revision_count;
|
var approval_count, review_count, receipt_count, revision_count, workflow_count;
|
||||||
var checkTasks = function() {
|
var checkTasks = function() {
|
||||||
$.ajax({url: '../out/out.Tasks.php',
|
$.ajax({url: '../out/out.Tasks.php',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -1011,15 +1011,17 @@ $(document).ready(function() { /* {{{ */
|
||||||
data: {action: 'counttasks'},
|
data: {action: 'counttasks'},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if(data) {
|
if(data) {
|
||||||
if(approval_count != data.data.approval ||
|
if((typeof data.data.approval != 'undefined' && approval_count != data.data.approval.length) ||
|
||||||
review_count != data.data.review ||
|
(typeof data.data.review != 'undefined' && review_count != data.data.review.length) ||
|
||||||
receipt_count != data.data.receipt ||
|
(typeof data.data.receipt != 'undefined' && receipt_count != data.data.receipt.length) ||
|
||||||
revision_count != data.data.revision) {
|
(typeof data.data.revision != 'undefined' && revision_count != data.data.revision.length) ||
|
||||||
|
(typeof data.data.workflow != 'undefined' && workflow_count != data.data.workflow.length)) {
|
||||||
$("#menu-tasks > ul > li").html('Loading').hide().load('../out/out.Tasks.php?action=menutasks').fadeIn('500')
|
$("#menu-tasks > ul > li").html('Loading').hide().load('../out/out.Tasks.php?action=menutasks').fadeIn('500')
|
||||||
approval_count = data.data.approval;
|
approval_count = typeof data.data.approval != 'undefined' ? data.data.approval.length : 0;
|
||||||
review_count = data.data.review;
|
review_count = typeof data.data.review != 'undefined' ? data.data.review.length : 0;
|
||||||
receipt_count = data.data.receipt;
|
receipt_count = typeof data.data.receipt != 'undefined' ? data.data.receipt.length : 0;
|
||||||
revision_count = data.data.revision;
|
revision_count = typeof data.data.revision != 'undefined' ? data.data.revision.length : 0;
|
||||||
|
workflow_count = typeof data.data.workflow != 'undefined' ? data.data.workflow.length : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,67 +39,87 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
|
||||||
private function __myTasks() { /* {{{ */
|
private function __myTasks() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
$workflowmode = $this->params['workflowmode'];
|
||||||
$tasksinmenu = $this->params['tasksinmenu'];
|
$tasksinmenu = $this->params['tasksinmenu'];
|
||||||
if(!$tasksinmenu || in_array('approval', $tasksinmenu)) {
|
|
||||||
$tasks['approval'] = array();
|
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval')
|
||||||
$resArr = $dms->getDocumentList('ApproveByMe', $user);
|
if(!$tasksinmenu || in_array('approval', $tasksinmenu)) {
|
||||||
if($resArr) {
|
$tasks['approval'] = array();
|
||||||
foreach ($resArr as $res) {
|
$resArr = $dms->getDocumentList('ApproveByMe', $user);
|
||||||
$document = $dms->getDocument($res["id"]);
|
if($resArr) {
|
||||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
foreach ($resArr as $res) {
|
||||||
$tasks['approval'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
$document = $dms->getDocument($res["id"]);
|
||||||
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
|
$tasks['approval'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if($workflowmode == 'traditional')
|
||||||
if(!$tasksinmenu || in_array('review', $tasksinmenu)) {
|
if(!$tasksinmenu || in_array('review', $tasksinmenu)) {
|
||||||
$tasks['review'] = array();
|
$tasks['review'] = array();
|
||||||
$resArr = $dms->getDocumentList('ReviewByMe', $user);
|
$resArr = $dms->getDocumentList('ReviewByMe', $user);
|
||||||
if($resArr) {
|
if($resArr) {
|
||||||
foreach ($resArr as $res) {
|
foreach ($resArr as $res) {
|
||||||
$document = $dms->getDocument($res["id"]);
|
$document = $dms->getDocument($res["id"]);
|
||||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
$tasks['review'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
$tasks['review'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if($workflowmode == 'traditional')
|
||||||
if(!$tasksinmenu || in_array('receipt', $tasksinmenu)) {
|
if(!$tasksinmenu || in_array('receipt', $tasksinmenu)) {
|
||||||
$tasks['receipt'] = array();
|
$tasks['receipt'] = array();
|
||||||
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
||||||
if($resArr) {
|
if($resArr) {
|
||||||
foreach ($resArr as $res) {
|
foreach ($resArr as $res) {
|
||||||
$document = $dms->getDocument($res["id"]);
|
$document = $dms->getDocument($res["id"]);
|
||||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
$tasks['receipt'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
$tasks['receipt'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if($workflowmode == 'traditional')
|
||||||
if(!$tasksinmenu || in_array('revision', $tasksinmenu)) {
|
if(!$tasksinmenu || in_array('revision', $tasksinmenu)) {
|
||||||
$tasks['revision'] = array();
|
$tasks['revision'] = array();
|
||||||
$resArr = $dms->getDocumentList('ReviseByMe', $user);
|
$resArr = $dms->getDocumentList('ReviseByMe', $user);
|
||||||
if($resArr) {
|
if($resArr) {
|
||||||
foreach ($resArr as $res) {
|
foreach ($resArr as $res) {
|
||||||
$document = $dms->getDocument($res["id"]);
|
$document = $dms->getDocument($res["id"]);
|
||||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
$tasks['revision'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
$tasks['revision'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if($workflowmode == 'traditional')
|
||||||
if(!$tasksinmenu || in_array('needscorrection', $tasksinmenu)) {
|
if(!$tasksinmenu || in_array('needscorrection', $tasksinmenu)) {
|
||||||
$tasks['needscorrection'] = array();
|
$tasks['needscorrection'] = array();
|
||||||
$resArr = $dms->getDocumentList('NeedsCorrectionOwner', $user);
|
$resArr = $dms->getDocumentList('NeedsCorrectionOwner', $user);
|
||||||
if($resArr) {
|
if($resArr) {
|
||||||
foreach ($resArr as $res) {
|
foreach ($resArr as $res) {
|
||||||
$document = $dms->getDocument($res["id"]);
|
$document = $dms->getDocument($res["id"]);
|
||||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
$tasks['needscorrection'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
$tasks['needscorrection'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($workflowmode == 'advanced')
|
||||||
|
if(!$tasksinmenu || in_array('workflow', $tasksinmenu)) {
|
||||||
|
$tasks['workflow'] = array();
|
||||||
|
$resArr = $dms->getDocumentList('WorkflowByMe', $user);
|
||||||
|
if($resArr) {
|
||||||
|
foreach ($resArr as $res) {
|
||||||
|
$document = $dms->getDocument($res["id"]);
|
||||||
|
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||||
|
$tasks['workflow'][] = array('id'=>$res['id'], 'name'=>$res['name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $tasks;
|
return $tasks;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -174,9 +194,11 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
|
||||||
$ct[] = count($tasks['revision']);
|
$ct[] = count($tasks['revision']);
|
||||||
if(isset($tasks['needscorrection']))
|
if(isset($tasks['needscorrection']))
|
||||||
$ct[] = count($tasks['needscorrection']);
|
$ct[] = count($tasks['needscorrection']);
|
||||||
|
if(isset($tasks['workflow']))
|
||||||
|
$ct[] = count($tasks['workflow']);
|
||||||
$content .= implode('/', $ct);
|
$content .= implode('/', $ct);
|
||||||
$content .= ")";
|
$content .= ")";
|
||||||
if(!empty($tasks['review']) || !empty($tasks['approval']) || !empty($tasks['receipt']) || !empty($tasks['revision']) || !empty($tasks['needscorrection'])) {
|
if(!empty($tasks['review']) || !empty($tasks['approval']) || !empty($tasks['receipt']) || !empty($tasks['revision']) || !empty($tasks['needscorrection']) || !empty($tasks['workflow'])) {
|
||||||
$content .= " <i class=\"icon-caret-down\"></i></a>\n";
|
$content .= " <i class=\"icon-caret-down\"></i></a>\n";
|
||||||
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
|
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
|
||||||
if(!empty($tasks['review'])) {
|
if(!empty($tasks['review'])) {
|
||||||
|
@ -212,6 +234,17 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
|
||||||
$content .= " </ul>\n";
|
$content .= " </ul>\n";
|
||||||
$content .= " </li>\n";
|
$content .= " </li>\n";
|
||||||
}
|
}
|
||||||
|
if(!empty($tasks['workflow'])) {
|
||||||
|
$content .= " <li class=\"dropdown-submenu\">\n";
|
||||||
|
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_trigger_workflow")."</a>\n";
|
||||||
|
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
|
||||||
|
foreach($tasks['workflow'] as $t) {
|
||||||
|
$doc = $dms->getDocument($t['id']);
|
||||||
|
$content .= " <li><a href=\"../out/out.ViewDocument.php?documentid=".$doc->getID()."¤ttab=workflow\">".$doc->getName()."</a></li>";
|
||||||
|
}
|
||||||
|
$content .= " </ul>\n";
|
||||||
|
$content .= " </li>\n";
|
||||||
|
}
|
||||||
if(!empty($tasks['revision'])) {
|
if(!empty($tasks['revision'])) {
|
||||||
$content .= " <li class=\"dropdown-submenu\">\n";
|
$content .= " <li class=\"dropdown-submenu\">\n";
|
||||||
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_revise")."</a>\n";
|
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText("documents_to_revise")."</a>\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user