use documentListRow() for output

This commit is contained in:
Uwe Steinmann 2016-08-11 22:57:53 +02:00
parent 4266e426db
commit d9d5c98c5f
3 changed files with 68 additions and 128 deletions

View File

@ -52,7 +52,6 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
$this->contentStart(); $this->contentStart();
$this->pageNavigation(getMLText("my_documents"), "my_documents"); $this->pageNavigation(getMLText("my_documents"), "my_documents");
$this->contentHeading(getMLText("approval_summary")); $this->contentHeading(getMLText("approval_summary"));
$this->contentContainerStart();
// Get document list for the current user. // Get document list for the current user.
$approvalStatus = $user->getApprovalStatus(); $approvalStatus = $user->getApprovalStatus();
@ -67,41 +66,31 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$previewer->createPreview($version); $previewer->createPreview($version);
$owner = $document->getOwner();
$moduser = $dms->getUser($st['required']); $moduser = $dms->getUser($st['required']);
if ($document && $version) { if ($document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</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"; $txt = $this->callHook('documentListItem', $document, $previewer);
$previewer->createPreview($version); if(is_string($txt))
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; echo $txt;
if($previewer->hasPreview($version)) { else {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
} else { echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
echo "</tr>";
} }
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>";
print "</tr>\n";
} }
if ($st["status"]!=-2) { if ($st["status"]!=-2) {
$iRev[] = $st["documentID"]; $iRev[] = $st["documentID"];
@ -113,49 +102,37 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_approval_needed"); printMLText("no_approval_needed");
} }
$this->contentContainerEnd();
$this->contentHeading(getMLText("group_approval_summary")); $this->contentHeading(getMLText("group_approval_summary"));
$this->contentContainerStart();
$printheader = true; $printheader = true;
foreach ($approvalStatus["grpstatus"] as $st) { foreach ($approvalStatus["grpstatus"] as $st) {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$modgroup = $dms->getGroup($st['required']); $modgroup = $dms->getGroup($st['required']);
if (!in_array($st["documentID"], $iRev) && $document && $version) { if (!in_array($st["documentID"], $iRev) && $document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</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"; $txt = $this->callHook('documentListItem', $document, $previewer);
$previewer->createPreview($version); if(is_string($txt))
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; echo $txt;
if($previewer->hasPreview($version)) { else {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
} else { echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>";
echo "</tr>";
} }
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>";
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>";
print "</tr>\n";
} }
} }
if (!$printheader) { if (!$printheader) {
@ -164,7 +141,6 @@ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_approval_needed"); printMLText("no_approval_needed");
} }
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */

View File

@ -48,7 +48,6 @@ class SeedDMS_View_ReceiptSummary extends SeedDMS_Bootstrap_Style {
$this->pageNavigation(getMLText("my_documents"), "my_documents"); $this->pageNavigation(getMLText("my_documents"), "my_documents");
$this->contentHeading(getMLText("receipt_summary")); $this->contentHeading(getMLText("receipt_summary"));
$this->contentContainerStart();
// TODO: verificare scadenza // TODO: verificare scadenza
@ -65,41 +64,31 @@ class SeedDMS_View_ReceiptSummary extends SeedDMS_Bootstrap_Style {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
if($document) if($document)
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$moduser = $dms->getUser($st['required']); $moduser = $dms->getUser($st['required']);
if ($document && $version) { if ($document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</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"; $txt = $this->callHook('documentListItem', $document, $previewer);
$previewer->createPreview($version); if(is_string($txt))
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; echo $txt;
if($previewer->hasPreview($version)) { else {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
} else { echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
echo "</tr>";
} }
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>";
print "</tr>\n";
} }
if ($st["status"]!=-2) { if ($st["status"]!=-2) {
$iRev[] = $st["documentID"]; $iRev[] = $st["documentID"];
@ -111,41 +100,39 @@ class SeedDMS_View_ReceiptSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_docs_to_receipt"); printMLText("no_docs_to_receipt");
} }
$this->contentContainerEnd();
$this->contentHeading(getMLText("group_receipt_summary")); $this->contentHeading(getMLText("group_receipt_summary"));
$this->contentContainerStart();
$printheader=true; $printheader=true;
foreach ($receiptStatus["grpstatus"] as $st) { foreach ($receiptStatus["grpstatus"] as $st) {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
if($document) if($document)
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$modgroup = $dms->getGroup($st['required']); $modgroup = $dms->getGroup($st['required']);
if (!in_array($st["documentID"], $iRev) && $document && $version) { if (!in_array($st["documentID"], $iRev) && $document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"folderView\">"; print "<table class=\"table table-condensed\">";
print "<thead>\n<tr>\n"; print "<thead>\n<tr>\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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</th>\n";
print "<th>".getMLText("expires")."</th>\n";
print "</tr>\n</thead>\n<tbody>\n"; print "</tr>\n</thead>\n<tbody>\n";
print "<table class=\"folderView\">";
$printheader=false; $printheader=false;
} }
print "<tr>\n"; $txt = $this->callHook('documentListItem', $document, $previewer);
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>"; if(is_string($txt))
print "<td>".htmlspecialchars($owner->getFullName())."</td>"; echo $txt;
print "<td>".getOverallStatusText($st["status"])."</td>"; else {
print "<td>".$st["version"]."</td>"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>"; echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>"; print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>";
print "</tr>\n"; echo "</tr>";
}
} }
} }
if (!$printheader) { if (!$printheader) {
@ -154,8 +141,6 @@ class SeedDMS_View_ReceiptSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_docs_to_receipt"); printMLText("no_docs_to_receipt");
} }
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */

View File

@ -53,7 +53,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
$this->pageNavigation(getMLText("my_documents"), "my_documents"); $this->pageNavigation(getMLText("my_documents"), "my_documents");
$this->contentHeading(getMLText("review_summary")); $this->contentHeading(getMLText("review_summary"));
$this->contentContainerStart(); // $this->contentContainerStart();
// TODO: verificare scadenza // TODO: verificare scadenza
@ -69,41 +69,31 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
foreach ($reviewStatus["indstatus"] as $st) { foreach ($reviewStatus["indstatus"] as $st) {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$moduser = $dms->getUser($st['required']); $moduser = $dms->getUser($st['required']);
if ($document && $version) { if ($document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</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"; $txt = $this->callHook('documentListItem', $document, $previewer);
$previewer->createPreview($version); if(is_string($txt))
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; echo $txt;
if($previewer->hasPreview($version)) { else {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
} else { echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
echo "</tr>";
} }
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."</td>";
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>";
print "</tr>\n";
} }
if ($st["status"]!=-2) { if ($st["status"]!=-2) {
$iRev[] = $st["documentID"]; $iRev[] = $st["documentID"];
@ -115,49 +105,39 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_docs_to_review"); printMLText("no_docs_to_review");
} }
$this->contentContainerEnd(); // $this->contentContainerEnd();
$this->contentHeading(getMLText("group_review_summary")); $this->contentHeading(getMLText("group_review_summary"));
$this->contentContainerStart(); // $this->contentContainerStart();
$printheader=true; $printheader=true;
foreach ($reviewStatus["grpstatus"] as $st) { foreach ($reviewStatus["grpstatus"] as $st) {
$document = $dms->getDocument($st['documentID']); $document = $dms->getDocument($st['documentID']);
$version = $document->getContentByVersion($st['version']); $version = $document->getContentByVersion($st['version']);
$owner = $document->getOwner();
$modgroup = $dms->getGroup($st['required']); $modgroup = $dms->getGroup($st['required']);
if (!in_array($st["documentID"], $iRev) && $document && $version) { if (!in_array($st["documentID"], $iRev) && $document && $version) {
if ($printheader){ if ($printheader){
print "<table class=\"folderView\">"; 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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("version")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th>".getMLText("last_update")."</th>\n"; print "<th>".getMLText("last_update")."</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"; $txt = $this->callHook('documentListItem', $document, $previewer);
$previewer->createPreview($version); if(is_string($txt))
print "<td><a href=\"../op/op.Download.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">"; echo $txt;
if($previewer->hasPreview($version)) { else {
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
} else { echo $this->documentListRow($document, $previewer, true, $st['version']);
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>";
echo "</tr>";
} }
print "</a></td>";
print "<td><a href=\"out.DocumentVersionDetail.php?documentid=".$st["documentID"]."&version=".$st["version"]."\">".htmlspecialchars($document->getName())."</a></td>";
print "<td>".htmlspecialchars($owner->getFullName())."</td>";
print "<td>".getOverallStatusText($st["status"])."</td>";
print "<td>".$st["version"]."</td>";
print "<td>".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."</td>";
print "<td>".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."</td>";
print "</tr>\n";
} }
} }
if (!$printheader) { if (!$printheader) {
@ -166,8 +146,7 @@ class SeedDMS_View_ReviewSummary extends SeedDMS_Bootstrap_Style {
printMLText("no_docs_to_review"); printMLText("no_docs_to_review");
} }
// $this->contentContainerEnd();
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */