mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
- use more icons in status column of document/folder list, fix getReadableDate()
This commit is contained in:
parent
af6f48db48
commit
2194c92801
|
@ -54,6 +54,8 @@ function getReadableDate($timestamp=0) { /* {{{ */
|
||||||
global $settings;
|
global $settings;
|
||||||
if($timestamp === 0)
|
if($timestamp === 0)
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
|
elseif($timestamp && is_numeric($timestamp))
|
||||||
|
;
|
||||||
elseif($timestamp && is_string($timestamp))
|
elseif($timestamp && is_string($timestamp))
|
||||||
$timestamp = strtotime($timestamp);
|
$timestamp = strtotime($timestamp);
|
||||||
elseif(!is_numeric($timestamp))
|
elseif(!is_numeric($timestamp))
|
||||||
|
|
|
@ -2898,22 +2898,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$status = $latestContent->getStatus();
|
$status = $latestContent->getStatus();
|
||||||
$attentionstr = '';
|
$attentionstr = '';
|
||||||
if ( $document->isLocked() ) {
|
if ( $document->isLocked() ) {
|
||||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
$attentionstr .= "<i class=\"fa fa-lock\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"></i> ";
|
||||||
}
|
}
|
||||||
$needwkflaction = false;
|
|
||||||
if($workflowmode == 'advanced') {
|
if($workflowmode == 'advanced') {
|
||||||
$workflow = $latestContent->getWorkflow();
|
$workflow = $latestContent->getWorkflow();
|
||||||
if($workflow) {
|
if($workflow && $latestContent->needsWorkflowAction($user)) {
|
||||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
$attentionstr .= "<i class=\"fa fa-exclamation-triangle\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"></i> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( $needwkflaction ) {
|
|
||||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
|
||||||
}
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if($attentionstr)
|
if($attentionstr)
|
||||||
$content .= $attentionstr."<br />";
|
$content .= $attentionstr."<br />";
|
||||||
$content .= "<small>";
|
|
||||||
/* Retrieve attacheѕ files */
|
/* Retrieve attacheѕ files */
|
||||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||||
|
@ -2926,17 +2922,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$revlinks = $document->getReverseDocumentLinks();
|
$revlinks = $document->getReverseDocumentLinks();
|
||||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||||
|
|
||||||
|
$content .= "<div class=\"font-size: 85%;\">";
|
||||||
if(count($files))
|
if(count($files))
|
||||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
$content .= '<i class="fa fa-paperclip" title="'.getMLText("linked_files").'"></i> '.count($files)."<br />";
|
||||||
if(count($links) || count($revlinks))
|
if(count($links) || count($revlinks))
|
||||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
$content .= '<i class="fa fa-link" title="'.getMLText("linked_documents").'"></i> '.count($links)."/".count($revlinks)."<br />";
|
||||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||||
if($workflowstate = $latestContent->getWorkflowState())
|
if($workflowstate = $latestContent->getWorkflowState())
|
||||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||||
} else {
|
} else {
|
||||||
$content .= getOverallStatusText($status["status"]);
|
$content .= $this->getOverallStatusIcon($status['status']);
|
||||||
}
|
}
|
||||||
$content .= "</small>";
|
$content .= "</div>";
|
||||||
return $content;
|
return $content;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -3206,21 +3203,25 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$content .= $extracontent['bottom_title'];
|
$content .= $extracontent['bottom_title'];
|
||||||
$content .= "</td>\n";
|
$content .= "</td>\n";
|
||||||
// $content .= "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
// $content .= "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||||
$content .= "<td colspan=\"1\" nowrap><small>";
|
$content .= "<td colspan=\"1\" nowrap><div style=\"font-size: 85%;\">";
|
||||||
if($enableRecursiveCount) {
|
if($enableRecursiveCount) {
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
/* No need to check for access rights in countChildren() for
|
/* No need to check for access rights in countChildren() for
|
||||||
* admin. So pass 0 as the limit.
|
* admin. So pass 0 as the limit.
|
||||||
*/
|
*/
|
||||||
$cc = $subFolder->countChildren($user, 0);
|
$cc = $subFolder->countChildren($user, 0);
|
||||||
$content .= $cc['folder_count']." ".getMLText("folders")."<br />".$cc['document_count']." ".getMLText("documents");
|
if($cc['folder_count'])
|
||||||
|
$content .= '<i class="fa fa-folder" title="'.getMLText("folders").'"></i> '.$cc['folder_count']."<br />";
|
||||||
|
if($cc['document_count'])
|
||||||
|
$content .= '<i class="fa fa-file" title="'.getMLText("documents").'"></i> '.$cc['document_count'];
|
||||||
} else {
|
} else {
|
||||||
$cc = $subFolder->countChildren($user, $maxRecursiveCount);
|
$cc = $subFolder->countChildren($user, $maxRecursiveCount);
|
||||||
if($maxRecursiveCount > 5000)
|
if($maxRecursiveCount > 5000)
|
||||||
$rr = 100.0;
|
$rr = 100.0;
|
||||||
else
|
else
|
||||||
$rr = 10.0;
|
$rr = 10.0;
|
||||||
$content .= (!$cc['folder_precise'] ? '~'.(round($cc['folder_count']/$rr)*$rr) : $cc['folder_count'])." ".getMLText("folders")."<br />".(!$cc['document_precise'] ? '~'.(round($cc['document_count']/$rr)*$rr) : $cc['document_count'])." ".getMLText("documents");
|
$content .= (!$cc['folder_precise'] ? '~'.(round($cc['folder_count']/$rr)*$rr) : $cc['folder_count'])." ".getMLText("folders")."<br />";
|
||||||
|
$content .= (!$cc['document_precise'] ? '~'.(round($cc['document_count']/$rr)*$rr) : $cc['document_count'])." ".getMLText("documents");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* FIXME: the following is very inefficient for just getting the number of
|
/* FIXME: the following is very inefficient for just getting the number of
|
||||||
|
@ -3233,7 +3234,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$subdoc = SeedDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
$subdoc = SeedDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
||||||
$content .= count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
|
$content .= count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
|
||||||
}
|
}
|
||||||
$content .= "</small></td>";
|
$content .= "</div></td>";
|
||||||
$content .= "<td>";
|
$content .= "<td>";
|
||||||
$content .= $this->folderListRowAction($subFolder, $skipcont, $extracontent);
|
$content .= $this->folderListRowAction($subFolder, $skipcont, $extracontent);
|
||||||
$content .= "</td>";
|
$content .= "</td>";
|
||||||
|
|
|
@ -338,6 +338,8 @@ i.warning {color: #ff9900;}
|
||||||
i.initstate {color: #ff9900;}
|
i.initstate {color: #ff9900;}
|
||||||
i.released {color: #00b000;}
|
i.released {color: #00b000;}
|
||||||
i.rejected {color: #b00000;}
|
i.rejected {color: #b00000;}
|
||||||
|
i.expired {color: #b0b0b0;}
|
||||||
|
i.obsolete {color: #9e5d42;}
|
||||||
i.in-workflow {color: #11479e;}
|
i.in-workflow {color: #11479e;}
|
||||||
i.workflow-action {color: #91479e;}
|
i.workflow-action {color: #91479e;}
|
||||||
i.selected {border: 1px solid #d4d4d4;padding:3px;border-radius:3px;background-color:#fafafa;background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);}
|
i.selected {border: 1px solid #d4d4d4;padding:3px;border-radius:3px;background-color:#fafafa;background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);}
|
||||||
|
|
|
@ -1278,6 +1278,51 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
function getOverallStatusIcon($status) { /* {{{ */
|
||||||
|
if (is_null($status)) {
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
|
$icon = '';
|
||||||
|
$color = '';
|
||||||
|
switch($status) {
|
||||||
|
case S_IN_WORKFLOW:
|
||||||
|
$icon = 'fa fa-circle in-workflow';
|
||||||
|
break;
|
||||||
|
case S_DRAFT_REV:
|
||||||
|
$icon = 'fa fa-circle in-workflow';
|
||||||
|
break;
|
||||||
|
case S_DRAFT_APP:
|
||||||
|
$icon = 'fa fa-circle in-workflow';
|
||||||
|
break;
|
||||||
|
case S_RELEASED:
|
||||||
|
$icon = 'fa-circle released';
|
||||||
|
break;
|
||||||
|
case S_REJECTED:
|
||||||
|
$icon = 'fa-circle rejected';
|
||||||
|
break;
|
||||||
|
case S_OBSOLETE:
|
||||||
|
$icon = 'fa-circle obsolete';
|
||||||
|
break;
|
||||||
|
case S_EXPIRED:
|
||||||
|
$icon = 'fa-circle expired';
|
||||||
|
break;
|
||||||
|
case S_IN_REVISION:
|
||||||
|
$icon = 'fa-refresh';
|
||||||
|
break;
|
||||||
|
case S_DRAFT:
|
||||||
|
$icon = 'fa-circle-o';
|
||||||
|
break;
|
||||||
|
case S_NEEDS_CORRECTION:
|
||||||
|
return getMLText("needs_correction");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$icon = 'fa fa-question';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return '<i class="fa '.$icon.'"'.($color ? ' style="color: '.$color.';"' : '').' title="'.getOverallStatusText($status).'"></i>';
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get attributes for a button opening a modal box
|
* Get attributes for a button opening a modal box
|
||||||
*
|
*
|
||||||
|
@ -2973,22 +3018,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$status = $latestContent->getStatus();
|
$status = $latestContent->getStatus();
|
||||||
$attentionstr = '';
|
$attentionstr = '';
|
||||||
if ( $document->isLocked() ) {
|
if ( $document->isLocked() ) {
|
||||||
$attentionstr .= "<img src=\"".$this->getImgPath("lock.png")."\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"> ";
|
$attentionstr .= "<i class=\"fa fa-lock\" title=\"". getMLText("locked_by").": ".htmlspecialchars($document->getLockingUser()->getFullName())."\"></i> ";
|
||||||
}
|
}
|
||||||
$needwkflaction = false;
|
|
||||||
if($workflowmode == 'advanced') {
|
if($workflowmode == 'advanced') {
|
||||||
$workflow = $latestContent->getWorkflow();
|
$workflow = $latestContent->getWorkflow();
|
||||||
if($workflow) {
|
if($workflow && $latestContent->needsWorkflowAction($user)) {
|
||||||
$needwkflaction = $latestContent->needsWorkflowAction($user);
|
$attentionstr .= "<i class=\"fa fa-exclamation-triangle\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"></i> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( $needwkflaction ) {
|
|
||||||
$attentionstr .= "<img src=\"".$this->getImgPath("attention.gif")."\" title=\"". getMLText("workflow").": ".htmlspecialchars($workflow->getName())."\"> ";
|
|
||||||
}
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if($attentionstr)
|
if($attentionstr)
|
||||||
$content .= $attentionstr."<br />";
|
$content .= $attentionstr."<br />";
|
||||||
$content .= "<small>";
|
|
||||||
/* Retrieve attacheѕ files */
|
/* Retrieve attacheѕ files */
|
||||||
$files = $document->getDocumentFiles($latestContent->getVersion());
|
$files = $document->getDocumentFiles($latestContent->getVersion());
|
||||||
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
$files = SeedDMS_Core_DMS::filterDocumentFiles($user, $files);
|
||||||
|
@ -3001,17 +3042,18 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$revlinks = $document->getReverseDocumentLinks();
|
$revlinks = $document->getReverseDocumentLinks();
|
||||||
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
$revlinks = SeedDMS_Core_DMS::filterDocumentLinks($user, $revlinks);
|
||||||
|
|
||||||
|
$content .= "<div class=\"font-size: 85%;\">";
|
||||||
if(count($files))
|
if(count($files))
|
||||||
$content .= count($files)." ".getMLText("linked_files")."<br />";
|
$content .= '<i class="fa fa-paperclip" title="'.getMLText("linked_files").'"></i> '.count($files)."<br />";
|
||||||
if(count($links) || count($revlinks))
|
if(count($links) || count($revlinks))
|
||||||
$content .= count($links)."/".count($revlinks)." ".getMLText("linked_documents")."<br />";
|
$content .= '<i class="fa fa-link" title="'.getMLText("linked_documents").'"></i> '.count($links)."/".count($revlinks)."<br />";
|
||||||
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
if($status["status"] == S_IN_WORKFLOW && $workflowmode == 'advanced') {
|
||||||
if($workflowstate = $latestContent->getWorkflowState())
|
if($workflowstate = $latestContent->getWorkflowState())
|
||||||
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
$content .= '<span title="'.getOverallStatusText($status["status"]).': '.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'.($workflowstate ? htmlspecialchars($workflowstate->getName()) : '').'</span>';
|
||||||
} else {
|
} else {
|
||||||
$content .= getOverallStatusText($status["status"]);
|
$content .= $this->getOverallStatusIcon($status['status']);
|
||||||
}
|
}
|
||||||
$content .= "</small>";
|
$content .= "</div>";
|
||||||
return $content;
|
return $content;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -3281,21 +3323,25 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$content .= $extracontent['bottom_title'];
|
$content .= $extracontent['bottom_title'];
|
||||||
$content .= "</td>\n";
|
$content .= "</td>\n";
|
||||||
// $content .= "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
// $content .= "<td>".htmlspecialchars($owner->getFullName())."</td>";
|
||||||
$content .= "<td colspan=\"1\" nowrap><small>";
|
$content .= "<td colspan=\"1\" nowrap><div style=\"font-size: 85%;\">";
|
||||||
if($enableRecursiveCount) {
|
if($enableRecursiveCount) {
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
/* No need to check for access rights in countChildren() for
|
/* No need to check for access rights in countChildren() for
|
||||||
* admin. So pass 0 as the limit.
|
* admin. So pass 0 as the limit.
|
||||||
*/
|
*/
|
||||||
$cc = $subFolder->countChildren($user, 0);
|
$cc = $subFolder->countChildren($user, 0);
|
||||||
$content .= $cc['folder_count']." ".getMLText("folders")."<br />".$cc['document_count']." ".getMLText("documents");
|
if($cc['folder_count'])
|
||||||
|
$content .= '<i class="fa fa-folder" title="'.getMLText("folders").'"></i> '.$cc['folder_count']."<br />";
|
||||||
|
if($cc['document_count'])
|
||||||
|
$content .= '<i class="fa fa-file" title="'.getMLText("documents").'"></i> '.$cc['document_count'];
|
||||||
} else {
|
} else {
|
||||||
$cc = $subFolder->countChildren($user, $maxRecursiveCount);
|
$cc = $subFolder->countChildren($user, $maxRecursiveCount);
|
||||||
if($maxRecursiveCount > 5000)
|
if($maxRecursiveCount > 5000)
|
||||||
$rr = 100.0;
|
$rr = 100.0;
|
||||||
else
|
else
|
||||||
$rr = 10.0;
|
$rr = 10.0;
|
||||||
$content .= (!$cc['folder_precise'] ? '~'.(round($cc['folder_count']/$rr)*$rr) : $cc['folder_count'])." ".getMLText("folders")."<br />".(!$cc['document_precise'] ? '~'.(round($cc['document_count']/$rr)*$rr) : $cc['document_count'])." ".getMLText("documents");
|
$content .= (!$cc['folder_precise'] ? '~'.(round($cc['folder_count']/$rr)*$rr) : $cc['folder_count'])." ".getMLText("folders")."<br />";
|
||||||
|
$content .= (!$cc['document_precise'] ? '~'.(round($cc['document_count']/$rr)*$rr) : $cc['document_count'])." ".getMLText("documents");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* FIXME: the following is very inefficient for just getting the number of
|
/* FIXME: the following is very inefficient for just getting the number of
|
||||||
|
@ -3308,7 +3354,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
$subdoc = SeedDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
$subdoc = SeedDMS_Core_DMS::filterAccess($subdoc, $user, M_READ);
|
||||||
$content .= count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
|
$content .= count($subsub)." ".getMLText("folders")."<br />".count($subdoc)." ".getMLText("documents");
|
||||||
}
|
}
|
||||||
$content .= "</small></td>";
|
$content .= "</div></td>";
|
||||||
$content .= "<td>";
|
$content .= "<td>";
|
||||||
$content .= $this->folderListRowAction($subFolder, $skipcont, $extracontent);
|
$content .= $this->folderListRowAction($subFolder, $skipcont, $extracontent);
|
||||||
$content .= "</td>";
|
$content .= "</td>";
|
||||||
|
|
|
@ -343,6 +343,8 @@ i.warning {color: #ff9900;}
|
||||||
i.initstate {color: #ff9900;}
|
i.initstate {color: #ff9900;}
|
||||||
i.released {color: #00b000;}
|
i.released {color: #00b000;}
|
||||||
i.rejected {color: #b00000;}
|
i.rejected {color: #b00000;}
|
||||||
|
i.expired {color: #b0b0b0;}
|
||||||
|
i.obsolete {color: #9e5d42;}
|
||||||
i.in-workflow {color: #11479e;}
|
i.in-workflow {color: #11479e;}
|
||||||
i.workflow-action {color: #91479e;}
|
i.workflow-action {color: #91479e;}
|
||||||
i.selected {border: 1px solid #d4d4d4;padding:3px;border-radius:3px;background-color:#fafafa;background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);}
|
i.selected {border: 1px solid #d4d4d4;padding:3px;border-radius:3px;background-color:#fafafa;background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user