mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-10-17 05:22:23 +00:00
add new function countTasks()
This commit is contained in:
parent
a4a1100abe
commit
fe6d00b6e1
|
@ -82,6 +82,34 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style {
|
|||
return $tasks;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns the html needed for the task list in the menu
|
||||
*
|
||||
* This function renders the tasks in a way suitable to be
|
||||
* used as a menu
|
||||
*
|
||||
* @param array $clipboard clipboard containing two arrays for both
|
||||
* documents and folders.
|
||||
* @return string html code
|
||||
*/
|
||||
function countTasks() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$startts = microtime(true);
|
||||
$tasks['review'] = 0;
|
||||
$tasks['approval'] = 0;
|
||||
$tasks['receipt'] = 0;
|
||||
$tasks['revision'] = 0;
|
||||
|
||||
$tasks['review'] = $dms->countTasks('ReviewByMe', $user);
|
||||
$tasks['approval'] = $dms->countTasks('ApproveByMe', $user);
|
||||
$tasks['receipt'] = $dms->countTasks('ReceiptByMe', $user);
|
||||
$tasks['revision'] = $dms->countTasks('ReviseByMe', $user);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(array('error'=>0, 'data'=>$tasks, 'processing_time'=>microtime(true)-$startts));
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns the html needed for the task list in the menu
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user