mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
add method documentListRowStatus()
This commit is contained in:
parent
4dda2549c7
commit
22915df3e1
|
@ -2883,6 +2883,56 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
return "</tr>\n";
|
||||
} /* }}} */
|
||||
|
||||
function documentListRowStatus($latestContent) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
$document = $latestContent->getDocument();
|
||||
|
||||
$status = $latestContent->getStatus();
|
||||
$attentionstr = '';
|
||||
if ( $document->isLocked() ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
$needwkflaction = false;
|
||||
if($workflowmode == 'advanced') {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if($workflow) {
|
||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
||||
}
|
||||
}
|
||||
if ( $needwkflaction ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
||||
}
|
||||
$content = '';
|
||||
if($attentionstr)
|
||||
$content .= $attentionstr."<br />";
|
||||
$content .= "<small>";
|
||||
/* Retrieve attacheѕ files */
|
||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||
|
||||
/* Retrieve linked documents */
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
|
||||
|
||||
/* Retrieve reverse linked documents */
|
||||
$revlinks = $document->getReverseDocumentLinks();
|
||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||
|
||||
if(count($files))
|
||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
||||
if(count($links) || count($revlinks))
|
||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||
if($workflowstate = $latestContent->getWorkflowState())
|
||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||
} else {
|
||||
$content .= getOverallStatusText($status["status"]);
|
||||
}
|
||||
$content .= "</small>";
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function documentListRowAction($document, $previewer, $skipcont=false, $version=0, $extracontent=array()) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
|
@ -2963,26 +3013,6 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$previewer->createPreview($latestContent);
|
||||
$version = $latestContent->getVersion();
|
||||
$status = $latestContent->getStatus();
|
||||
$needwkflaction = false;
|
||||
if($workflowmode == 'advanced') {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if($workflow) {
|
||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
||||
}
|
||||
}
|
||||
|
||||
/* Retrieve attacheѕ files */
|
||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||
|
||||
/* Retrieve linked documents */
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
|
||||
|
||||
/* Retrieve reverse linked documents */
|
||||
$revlinks = $document->getReverseDocumentLinks();
|
||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||
|
||||
if($ec = $this->callHook('documentListRowExtraContent', $document, $latestContent))
|
||||
$extracontent = array_merge($extracontent, $ec);
|
||||
|
@ -3037,27 +3067,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
|
||||
$content .= "<td nowrap>";
|
||||
$attentionstr = '';
|
||||
if ( $document->isLocked() ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
if ( $needwkflaction ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
||||
}
|
||||
if($attentionstr)
|
||||
$content .= $attentionstr."<br />";
|
||||
$content .= "<small>";
|
||||
if(count($files))
|
||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
||||
if(count($links) || count($revlinks))
|
||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||
if($workflowstate = $latestContent->getWorkflowState())
|
||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||
} else {
|
||||
$content .= getOverallStatusText($status["status"]);
|
||||
}
|
||||
$content .= "</small></td>";
|
||||
$content .= $this->documentListRowStatus($latestContent);
|
||||
$content .= "</td>";
|
||||
$content .= "<td>";
|
||||
$content .= $this->documentListRowAction($document, $previewer, $skipcont, $version, $extracontent);
|
||||
$content .= "</td>";
|
||||
|
|
|
@ -2954,6 +2954,56 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
return "</tr>\n";
|
||||
} /* }}} */
|
||||
|
||||
function documentListRowStatus($latestContent) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
$document = $latestContent->getDocument();
|
||||
|
||||
$status = $latestContent->getStatus();
|
||||
$attentionstr = '';
|
||||
if ( $document->isLocked() ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
$needwkflaction = false;
|
||||
if($workflowmode == 'advanced') {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if($workflow) {
|
||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
||||
}
|
||||
}
|
||||
if ( $needwkflaction ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
||||
}
|
||||
$content = '';
|
||||
if($attentionstr)
|
||||
$content .= $attentionstr."<br />";
|
||||
$content .= "<small>";
|
||||
/* Retrieve attacheѕ files */
|
||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||
|
||||
/* Retrieve linked documents */
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
|
||||
|
||||
/* Retrieve reverse linked documents */
|
||||
$revlinks = $document->getReverseDocumentLinks();
|
||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||
|
||||
if(count($files))
|
||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
||||
if(count($links) || count($revlinks))
|
||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||
if($workflowstate = $latestContent->getWorkflowState())
|
||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||
} else {
|
||||
$content .= getOverallStatusText($status["status"]);
|
||||
}
|
||||
$content .= "</small>";
|
||||
return $content;
|
||||
} /* }}} */
|
||||
|
||||
function documentListRowAction($document, $previewer, $skipcont=false, $version=0, $extracontent=array()) { /* {{{ */
|
||||
$user = $this->params['user'];
|
||||
$enableClipboard = $this->params['enableclipboard'];
|
||||
|
@ -3034,26 +3084,6 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$previewer->createPreview($latestContent);
|
||||
$version = $latestContent->getVersion();
|
||||
$status = $latestContent->getStatus();
|
||||
$needwkflaction = false;
|
||||
if($workflowmode == 'advanced') {
|
||||
$workflow = $latestContent->getWorkflow();
|
||||
if($workflow) {
|
||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
||||
}
|
||||
}
|
||||
|
||||
/* Retrieve attacheѕ files */
|
||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||
|
||||
/* Retrieve linked documents */
|
||||
$links = $document->getDocumentLinks();
|
||||
$links = SeedDMS_Core_DMS::filterDocumentLinks($user, $links);
|
||||
|
||||
/* Retrieve reverse linked documents */
|
||||
$revlinks = $document->getReverseDocumentLinks();
|
||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||
|
||||
if($ec = $this->callHook('documentListRowExtraContent', $document, $latestContent))
|
||||
$extracontent = array_merge($extracontent, $ec);
|
||||
|
@ -3108,27 +3138,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
|
||||
$content .= "<td nowrap>";
|
||||
$attentionstr = '';
|
||||
if ( $document->isLocked() ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
||||
}
|
||||
if ( $needwkflaction ) {
|
||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
||||
}
|
||||
if($attentionstr)
|
||||
$content .= $attentionstr."<br />";
|
||||
$content .= "<small>";
|
||||
if(count($files))
|
||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
||||
if(count($links) || count($revlinks))
|
||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||
if($workflowstate = $latestContent->getWorkflowState())
|
||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||
} else {
|
||||
$content .= getOverallStatusText($status["status"]);
|
||||
}
|
||||
$content .= "</small></td>";
|
||||
$content .= $this->documentListRowStatus($latestContent);
|
||||
$content .= "</td>";
|
||||
$content .= "<td>";
|
||||
$content .= $this->documentListRowAction($document, $previewer, $skipcont, $version, $extracontent);
|
||||
$content .= "</td>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user