propperly take new workflow mode traditional_only_approval into account

This commit is contained in:
Uwe Steinmann 2015-03-17 11:19:55 +01:00
parent 4c41f560c3
commit cb3392c774
6 changed files with 100 additions and 90 deletions

View File

@ -222,7 +222,7 @@ $(document).ready(function() {
<?php <?php
} }
} }
if($workflowmode != 'traditional') { if($workflowmode == 'advanced') {
?> ?>
<tr> <tr>
<td> <td>
@ -262,6 +262,7 @@ $(document).ready(function() {
</tr> </tr>
<?php <?php
} else { } else {
if($workflowmode == 'traditional') {
?> ?>
<tr> <tr>
<td> <td>
@ -372,7 +373,7 @@ $(document).ready(function() {
?> ?>
</td> </td>
</tr> </tr>
<?php } ?>
<tr> <tr>
<td> <td>
<?php $this->contentSubHeading(getMLText("assign_approvers")); ?> <?php $this->contentSubHeading(getMLText("assign_approvers")); ?>

View File

@ -62,7 +62,7 @@ class SeedDMS_View_AdminTools extends SeedDMS_Bootstrap_Style {
<a href="../out/out.AttributeMgr.php" class="span3 btn btn-medium"><i class="icon-tags"></i><br /><?php echo getMLText("global_attributedefinitions")?></a> <a href="../out/out.AttributeMgr.php" class="span3 btn btn-medium"><i class="icon-tags"></i><br /><?php echo getMLText("global_attributedefinitions")?></a>
</div> </div>
<?php <?php
if($this->params['workflowmode'] != 'traditional') { if($this->params['workflowmode'] == 'advanced') {
?> ?>
<div class="row-fluid"> <div class="row-fluid">
<a href="../out/out.WorkflowMgr.php" class="span3 btn btn-medium"><i class="icon-sitemap"></i><br /><?php echo getMLText("global_workflows"); ?></a> <a href="../out/out.WorkflowMgr.php" class="span3 btn btn-medium"><i class="icon-sitemap"></i><br /><?php echo getMLText("global_workflows"); ?></a>

View File

@ -494,8 +494,9 @@ $(document).ready(function () {
echo "<li><a href=\"../out/out.MyDocuments.php?inProcess=1\">".getMLText("documents_in_process")."</a></li>\n"; echo "<li><a href=\"../out/out.MyDocuments.php?inProcess=1\">".getMLText("documents_in_process")."</a></li>\n";
echo "<li><a href=\"../out/out.MyDocuments.php\">".getMLText("all_documents")."</a></li>\n"; echo "<li><a href=\"../out/out.MyDocuments.php\">".getMLText("all_documents")."</a></li>\n";
if($this->params['workflowmode'] == 'traditional') { if($this->params['workflowmode'] == 'traditional' || $this->params['workflowmode'] == 'traditional_only_approval') {
echo "<li><a href=\"../out/out.ReviewSummary.php\">".getMLText("review_summary")."</a></li>\n"; if($this->params['workflowmode'] == 'traditional')
echo "<li><a href=\"../out/out.ReviewSummary.php\">".getMLText("review_summary")."</a></li>\n";
echo "<li><a href=\"../out/out.ApprovalSummary.php\">".getMLText("approval_summary")."</a></li>\n"; echo "<li><a href=\"../out/out.ApprovalSummary.php\">".getMLText("approval_summary")."</a></li>\n";
} else { } else {
echo "<li><a href=\"../out/out.WorkflowSummary.php\">".getMLText("workflow_summary")."</a></li>\n"; echo "<li><a href=\"../out/out.WorkflowSummary.php\">".getMLText("workflow_summary")."</a></li>\n";
@ -527,7 +528,7 @@ $(document).ready(function () {
echo " <li><a href=\"../out/out.DefaultKeywords.php\">".getMLText("global_default_keywords")."</a></li>\n"; echo " <li><a href=\"../out/out.DefaultKeywords.php\">".getMLText("global_default_keywords")."</a></li>\n";
echo " <li><a href=\"../out/out.Categories.php\">".getMLText("global_document_categories")."</a></li>\n"; echo " <li><a href=\"../out/out.Categories.php\">".getMLText("global_document_categories")."</a></li>\n";
echo " <li><a href=\"../out/out.AttributeMgr.php\">".getMLText("global_attributedefinitions")."</a></li>\n"; echo " <li><a href=\"../out/out.AttributeMgr.php\">".getMLText("global_attributedefinitions")."</a></li>\n";
if($this->params['workflowmode'] != 'traditional') { if($this->params['workflowmode'] == 'advanced') {
echo " <li><a href=\"../out/out.WorkflowMgr.php\">".getMLText("global_workflows")."</a></li>\n"; echo " <li><a href=\"../out/out.WorkflowMgr.php\">".getMLText("global_workflows")."</a></li>\n";
echo " <li><a href=\"../out/out.WorkflowStatesMgr.php\">".getMLText("global_workflow_states")."</a></li>\n"; echo " <li><a href=\"../out/out.WorkflowStatesMgr.php\">".getMLText("global_workflow_states")."</a></li>\n";
echo " <li><a href=\"../out/out.WorkflowActionsMgr.php\">".getMLText("global_workflow_actions")."</a></li>\n"; echo " <li><a href=\"../out/out.WorkflowActionsMgr.php\">".getMLText("global_workflow_actions")."</a></li>\n";

View File

@ -57,7 +57,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
exit; exit;
} }
if($workflowmode == 'traditional') { if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
// Get document list for the current user. // Get document list for the current user.
$reviewStatus = $user->getReviewStatus(); $reviewStatus = $user->getReviewStatus();
$approvalStatus = $user->getApprovalStatus(); $approvalStatus = $user->getApprovalStatus();
@ -137,91 +137,93 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
} }
// List the documents where a review has been requested. // List the documents where a review has been requested.
$this->contentHeading(getMLText("documents_to_review")); if($workflowmode == 'traditional') {
$this->contentContainerStart(); $this->contentHeading(getMLText("documents_to_review"));
$printheader=true; $this->contentContainerStart();
$iRev = array(); $printheader=true;
$dList = array(); $iRev = array();
foreach ($reviewStatus["indstatus"] as $st) { $dList = array();
foreach ($reviewStatus["indstatus"] as $st) {
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
$dList[] = $st["documentID"];
$document = $dms->getDocument($st["documentID"]);
if ($printheader){ if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
print "<table class=\"table table-condensed\">"; $dList[] = $st["documentID"];
print "<thead>\n<tr>\n"; $document = $dms->getDocument($st["documentID"]);
print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n"; if ($printheader){
print "<th>".getMLText("owner")."</th>\n"; print "<table class=\"table table-condensed\">";
print "<th>".getMLText("version")."</th>\n"; print "<thead>\n<tr>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th></th>\n";
print "<th>".getMLText("expires")."</th>\n"; print "<th>".getMLText("name")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n"; print "<th>".getMLText("owner")."</th>\n";
$printheader=false; print "<th>".getMLText("version")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n";
print "<th>".getMLText("expires")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n";
$printheader=false;
}
print "<tr>\n";
$latestContent = $document->getLatestContent();
$previewer->createPreview($latestContent);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($latestContent)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
print "</tr>\n";
} }
}
foreach ($reviewStatus["grpstatus"] as $st) {
print "<tr>\n"; if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
$latestContent = $document->getLatestContent(); $dList[] = $st["documentID"];
$previewer->createPreview($latestContent); $document = $dms->getDocument($st["documentID"]);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($latestContent)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"]) ."</td>";
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
print "</tr>\n";
}
}
foreach ($reviewStatus["grpstatus"] as $st) {
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
$dList[] = $st["documentID"];
$document = $dms->getDocument($st["documentID"]);
if ($printheader){ if ($printheader){
print "<table class=\"table table-condensed\">"; print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n"; print "<thead>\n<tr>\n";
print "<th></th>\n"; print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n"; print "<th>".getMLText("name")."</th>\n";
print "<th>".getMLText("owner")."</th>\n"; print "<th>".getMLText("owner")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("version")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</th>\n";
print "<th>".getMLText("expires")."</th>\n"; print "<th>".getMLText("expires")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n"; print "</tr>\n</thead>\n<tbody>\n";
$printheader=false; $printheader=false;
} }
print "<tr>\n"; print "<tr>\n";
$latestContent = $document->getLatestContent(); $latestContent = $document->getLatestContent();
$previewer->createPreview($latestContent); $previewer->createPreview($latestContent);
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">";
if($previewer->hasPreview($latestContent)) { if($previewer->hasPreview($latestContent)) {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
} else { } else {
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
}
print "</a></td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"])."</td>";
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
print "</tr>\n";
} }
print "</a></td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$st["documentID"]."\">".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["name"])."</a></td>";
print "<td>".htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["ownerName"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($docIdx[$st["documentID"]][$st["version"]]["statusName"])."</td>";
print "<td".($docIdx[$st["documentID"]][$st["version"]]['status']!=S_EXPIRED?"":" class=\"warning\"").">".(!$docIdx[$st["documentID"]][$st["version"]]["expires"] ? "-":getReadableDate($docIdx[$st["documentID"]][$st["version"]]["expires"]))."</td>";
print "</tr>\n";
} }
if (!$printheader){
echo "</tbody>\n</table>";
}else{
printMLText("no_docs_to_review");
}
$this->contentContainerEnd();
} }
if (!$printheader){
echo "</tbody>\n</table>";
}else{
printMLText("no_docs_to_review");
}
$this->contentContainerEnd();
// List the documents where an approval has been requested. // List the documents where an approval has been requested.
$this->contentHeading(getMLText("documents_to_approve")); $this->contentHeading(getMLText("documents_to_approve"));
@ -306,11 +308,12 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
$this->contentContainerEnd(); $this->contentContainerEnd();
} }
else { else {
if($workflowmode == 'traditional') {
$this->contentHeading(getMLText("documents_to_review")); $this->contentHeading(getMLText("documents_to_review"));
$this->contentContainerStart(); $this->contentContainerStart();
printMLText("no_review_needed"); printMLText("no_review_needed");
$this->contentContainerEnd(); $this->contentContainerEnd();
}
$this->contentHeading(getMLText("documents_to_approve")); $this->contentHeading(getMLText("documents_to_approve"));
$this->contentContainerStart(); $this->contentContainerStart();
printMLText("no_approval_needed"); printMLText("no_approval_needed");

View File

@ -240,8 +240,10 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style {
<tr> <tr>
<td><?php printMLText("status");?>:</td> <td><?php printMLText("status");?>:</td>
<td> <td>
<?php if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { ?>
<?php if($workflowmode == 'traditional') { ?> <?php if($workflowmode == 'traditional') { ?>
<label class="checkbox" for='pendingReview'><input type="checkbox" id="pendingReview" name="pendingReview" value="1" <?php echo in_array(S_DRAFT_REV, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_REV);?></label> <label class="checkbox" for='pendingReview'><input type="checkbox" id="pendingReview" name="pendingReview" value="1" <?php echo in_array(S_DRAFT_REV, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_REV);?></label>
<?php } ?>
<label class="checkbox" for='pendingApproval'><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1" <?php echo in_array(S_DRAFT_APP, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_APP);?></label> <label class="checkbox" for='pendingApproval'><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1" <?php echo in_array(S_DRAFT_APP, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_APP);?></label>
<?php } else { ?> <?php } else { ?>
<label class="checkbox" for='inWorkflow'><input type="checkbox" id="inWorkflow" name="inWorkflow" value="1" <?php echo in_array(S_IN_WORKFLOW, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_IN_WORKFLOW);?></label> <label class="checkbox" for='inWorkflow'><input type="checkbox" id="inWorkflow" name="inWorkflow" value="1" <?php echo in_array(S_IN_WORKFLOW, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_IN_WORKFLOW);?></label>

View File

@ -185,6 +185,7 @@ class SeedDMS_View_UsrMgr extends SeedDMS_Bootstrap_Style {
<?php <?php
} }
if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') {
if($workflowmode == "traditional") { if($workflowmode == "traditional") {
?> ?>
@ -236,7 +237,9 @@ class SeedDMS_View_UsrMgr extends SeedDMS_Bootstrap_Style {
</select> </select>
</td> </td>
</tr> </tr>
<?php
}
?>
<tr> <tr>
<td colspan="2"><?php printMLText("approvers");?>:</td> <td colspan="2"><?php printMLText("approvers");?>:</td>
</tr> </tr>