mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-31 14:07:16 +00:00
fix approving of documents
The variable $status was overridden in the the status log if logged in as admin. This causse problems whenever was allow to review/approve documents. All other users where not affected because the don't see the status log
This commit is contained in:
parent
7ea3c9a73a
commit
e36d4c0094
|
@ -401,11 +401,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
if($user->isAdmin()) {
|
||||
$this->contentHeading(getMLText("status"));
|
||||
$this->contentContainerStart();
|
||||
$status = $latestContent->getStatusLog();
|
||||
$statuslog = $latestContent->getStatusLog();
|
||||
echo "<table class=\"table table-condensed\"><thead>";
|
||||
echo "<th>".getMLText('date')."</th><th>".getMLText('status')."</th><th>".getMLText('user')."</th><th>".getMLText('comment')."</th></tr>\n";
|
||||
echo "</thead><tbody>";
|
||||
foreach($status as $entry) {
|
||||
foreach($statuslog as $entry) {
|
||||
if($suser = $dms->getUser($entry['userID']))
|
||||
$fullname = $suser->getFullName();
|
||||
else
|
||||
|
@ -452,7 +452,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<tr><td colspan=5>\n";
|
||||
$this->contentSubHeading(getMLText("reviewers"));
|
||||
print "</tr>";
|
||||
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
print "<td width='20%'><b>".getMLText("last_update")."</b></td>\n";
|
||||
|
@ -505,7 +505,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<li><a href=\"../out/out.ReviewDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&reviewid=".$r['reviewID']."\" class=\"btn btn-mini\">".getMLText("edit")."</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</ul></td>\n";
|
||||
print "</td>\n</tr>\n";
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td>".htmlspecialchars($a["comment"])."</td>\n";
|
||||
print "<td>".getApprovalStatusText($a["status"])."</td>\n";
|
||||
print "<td><ul class=\"unstyled\">";
|
||||
|
||||
|
||||
if($accessop->mayApprove()) {
|
||||
if ($is_approver && $status["status"]==S_DRAFT_APP) {
|
||||
print "<li><a class=\"btn btn-mini\" href=\"../out/out.ApproveDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("submit_approval")."</a></li>";
|
||||
|
@ -569,7 +569,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<li><a class=\"btn btn-mini\" href=\"../out/out.ApproveDocument.php?documentid=".$documentid."&version=".$latestContent->getVersion()."&approveid=".$a['approveID']."\">".getMLText("edit")."</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "</ul>";
|
||||
print "</td>\n";
|
||||
print "</td>\n</tr>\n";
|
||||
|
@ -781,10 +781,10 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$vstat = $version->getStatus();
|
||||
$workflow = $version->getWorkflow();
|
||||
$workflowstate = $version->getWorkflowState();
|
||||
|
||||
|
||||
// verify if file exists
|
||||
$file_exists=file_exists($dms->contentDir . $version->getPath());
|
||||
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td nowrap>";
|
||||
/*
|
||||
|
@ -794,7 +794,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
|
||||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&version=".$version->getVersion()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a>";
|
||||
}else print "<li><img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">";
|
||||
|
||||
|
||||
print "</ul>";
|
||||
*/
|
||||
if ($viewonlinefiletypes && in_array(strtolower($version->getFileType()), $viewonlinefiletypes))
|
||||
|
@ -879,7 +879,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
foreach($files as $file) {
|
||||
|
||||
$file_exists=file_exists($dms->contentDir . $file->getPath());
|
||||
|
||||
|
||||
$responsibleUser = $file->getUser();
|
||||
|
||||
print "<tr>";
|
||||
|
@ -890,7 +890,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$documentid."&file=". $file->getID()."\"><i class=\"icon-star\"></i>" . getMLText("view_online") . "</a></li>";
|
||||
} else print "<li><img class=\"mimeicon\" src=\"images/icons/".$this->getMimeIcon($file->getFileType())."\" title=\"".htmlspecialchars($file->getMimeType())."\">";
|
||||
print "</ul></td>";
|
||||
|
||||
|
||||
print "<td><ul class=\"unstyled\">\n";
|
||||
print "<li>".htmlspecialchars($file->getName())."</li>\n";
|
||||
print "<li>".htmlspecialchars($file->getOriginalFileName())."</li>\n";
|
||||
|
@ -902,12 +902,12 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<li>".getLongReadableDate($file->getDate())."</li>";
|
||||
|
||||
print "<td>".htmlspecialchars($file->getComment())."</td>";
|
||||
|
||||
|
||||
print "<td><span class=\"actions\">";
|
||||
if (($document->getAccessMode($user) == M_ALL)||($file->getUserID()==$user->getID()))
|
||||
print "<form action=\"../out/out.RemoveDocumentFile.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"fileid\" value=\"".$file->getID()."\" /><button type=\"submit\" class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</button></form>";
|
||||
print "</span></td>";
|
||||
|
||||
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tbody>\n</table>\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user