* @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ require_once("class.Bootstrap.php"); /** * Include class to preview documents */ require_once("SeedDMS/Preview.php"); /** * Class which outputs the html page for ApprovalSummary view * * @category DMS * @package SeedDMS * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_ApprovalSummary extends SeedDMS_Bootstrap_Style { function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $timeout = $this->params['timeout']; $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout); $this->htmlStartPage(getMLText("approval_summary")); $this->globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("my_documents"), "my_documents"); $this->contentHeading(getMLText("approval_summary")); $this->contentContainerStart(); // Get document list for the current user. $approvalStatus = $user->getApprovalStatus(); // reverse order $approvalStatus["indstatus"]=array_reverse($approvalStatus["indstatus"],true); $approvalStatus["grpstatus"]=array_reverse($approvalStatus["grpstatus"],true); $iRev = array(); $printheader = true; foreach ($approvalStatus["indstatus"] as $st) { $document = $dms->getDocument($st['documentID']); $version = $document->getContentByVersion($st['version']); $previewer->createPreview($version); $owner = $document->getOwner(); $moduser = $dms->getUser($st['required']); if ($document && $version) { if ($printheader){ print ""; print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n\n\n"; $printheader = false; } print "\n"; $previewer->createPreview($version); print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; } if ($st["status"]!=-2) { $iRev[] = $st["documentID"]; } } if (!$printheader) { echo "\n
".getMLText("name")."".getMLText("owner")."".getMLText("status")."".getMLText("version")."".getMLText("last_update")."".getMLText("expires")."
"; if($previewer->hasPreview($version)) { print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; } else { print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; } print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getApprovalStatusText($st["status"])."".$st["version"]."".$st["date"]." ". htmlspecialchars($moduser->getFullName()) ."".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."
\n"; }else{ printMLText("no_approval_needed"); } $this->contentContainerEnd(); $this->contentHeading(getMLText("group_approval_summary")); $this->contentContainerStart(); $printheader = true; foreach ($approvalStatus["grpstatus"] as $st) { $document = $dms->getDocument($st['documentID']); $version = $document->getContentByVersion($st['version']); $owner = $document->getOwner(); $modgroup = $dms->getGroup($st['required']); if (!in_array($st["documentID"], $iRev) && $document && $version) { if ($printheader){ print ""; print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n\n\n"; $printheader = false; } print "\n"; $previewer->createPreview($version); print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; } } if (!$printheader) { echo "\n
".getMLText("name")."".getMLText("owner")."".getMLText("status")."".getMLText("version")."".getMLText("last_update")."".getMLText("expires")."
"; if($previewer->hasPreview($version)) { print "getID()."&version=".$version->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; } else { print "getMimeIcon($version->getFileType())."\" title=\"".htmlspecialchars($version->getMimeType())."\">"; } print "".htmlspecialchars($document->getName())."".htmlspecialchars($owner->getFullName())."".getApprovalStatusText($st["status"])."".$st["version"]."".$st["date"]." ". htmlspecialchars($modgroup->getName()) ."".(!$document->expires() ? "-":getReadableDate($document->getExpires()))."
\n"; }else{ printMLText("no_approval_needed"); } $this->contentContainerEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>