overhaul ManageNotify, support onepage mode, use standard output for documents and folders

This commit is contained in:
Uwe Steinmann 2020-03-05 09:12:45 +01:00
parent 09f5943eb0
commit 49bebebdae
2 changed files with 24 additions and 39 deletions

View File

@ -38,6 +38,7 @@ if($view) {
$view->setParam('cachedir', $settings->_cacheDir); $view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('previewWidthList', $settings->_previewWidthList); $view->setParam('previewWidthList', $settings->_previewWidthList);
$view->setParam('timeout', $settings->_cmdTimeout); $view->setParam('timeout', $settings->_cmdTimeout);
$view->setParam('onepage', $settings->_onePageMode); // do most navigation by reloading areas of pages with ajax
$view->setParam('xsendfile', $settings->_enableXsendfile); $view->setParam('xsendfile', $settings->_enableXsendfile);
$view($_GET); $view($_GET);
exit; exit;

View File

@ -64,7 +64,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
} }
else { else {
print "<table class=\"table-condensed\">"; print "<table class=\"table table-condensed\">";
print "<thead><tr>\n"; print "<thead><tr>\n";
print "<th></th>\n"; print "<th></th>\n";
print "<th>".getMLText("name")."</th>\n"; print "<th>".getMLText("name")."</th>\n";
@ -74,15 +74,18 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
foreach($notifications as $notification) { foreach($notifications as $notification) {
$fld = $this->dms->getFolder($notification->getTarget()); $fld = $this->dms->getFolder($notification->getTarget());
if (is_object($fld)) { if (is_object($fld)) {
$owner = $fld->getOwner(); echo $this->folderListRowStart($fld);
print "<tr class=\"folder\">"; $txt = $this->callHook('folderListItem', $fld, true, 'viewfolder');
print "<td><i class=\"icon-folder-close-alt\"></i></td>"; if(is_string($txt))
print "<td><a href=\"../out/out.ViewFolder.php?folderid=".$fld->getID()."\">" . htmlspecialchars($fld->getName()) . "</a></td>\n"; echo $txt;
print "<td>".htmlspecialchars($owner->getFullName())."</td>"; else {
echo $this->folderListRow($fld, true);
}
print "<td>"; print "<td>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$fld->getID()."&type=folder&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>"; if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$fld->getID()."&type=folder&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.FolderNotify.php?folderid=".$fld->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>"; else print "<a href='../out/out.FolderNotify.php?folderid=".$fld->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>"; print "</td>";
echo $this->folderListRowEnd($fld);
} }
} }
print "</tbody></table>"; print "</tbody></table>";
@ -97,42 +100,30 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
else { else {
$previewer = new SeedDMS_Preview_Previewer($this->cachedir, $this->previewwidth, $this->timeout, $this->xsendfile); $previewer = new SeedDMS_Preview_Previewer($this->cachedir, $this->previewwidth, $this->timeout, $this->xsendfile);
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("status")."</th>\n"; print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n"; print "<th>".getMLText("action")."</th>\n";
print "<th></th>\n";
print "</tr></thead>\n<tbody>\n"; print "</tr></thead>\n<tbody>\n";
foreach ($notifications as $notification) { foreach ($notifications as $notification) {
$doc = $this->dms->getDocument($notification->getTarget()); $doc = $this->dms->getDocument($notification->getTarget());
if (is_object($doc)) { if (is_object($doc)) {
$owner = $doc->getOwner(); $doc->verifyLastestContentExpriry();
$latest = $doc->getLatestContent(); echo $this->documentListRowStart($doc);
$status = $latest->getStatus(); $txt = $this->callHook('documentListItem', $doc, $previewer, true, 'managenotify');
$previewer->createPreview($latest); if(is_string($txt))
print "<tr>\n"; echo $txt;
print "<td>"; else {
if($previewer->hasPreview($latest)) { echo $this->documentListRow($doc, $previewer, true);
print "<img class=\"mimeicon\" width=\"".$this->previewwidth."\" src=\"../op/op.Preview.php?documentid=".$doc->getID()."&version=".$latest->getVersion()."&width=".$this->previewwidth."\" title=\"".htmlspecialchars($latest->getMimeType())."\">";
} else {
print "<img class=\"mimeicon\" width=\"".$this->previewwidth."\" src=\"".$this->getMimeIcon($latest->getFileType())."\" title=\"".htmlspecialchars($latest->getMimeType())."\">";
} }
print "</td>";
print "<td><a href=\"out.ViewDocument.php?documentid=".$doc->getID()."\">" . htmlspecialchars($doc->getName()) . "</a>";
print "<br /><span style=\"font-size: 85%; font-style: italic; color: #666; \">".getMLText('owner').": <b>".htmlspecialchars($owner->getFullName())."</b>, ".getMLText('creation_date').": <b>".date('Y-m-d', $doc->getDate())."</b>, ".getMLText('version')." <b>".$latest->getVersion()."</b> - <b>".date('Y-m-d', $latest->getDate())."</b></span>";
$comment = $latest->getComment();
if($comment) {
print "<br /><span style=\"font-size: 85%;\">".htmlspecialchars($comment)."</span>";
}
print "</td>\n";
print "<td>".getOverallStatusText($status["status"])."</td>";
print "<td>"; print "<td>";
if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$doc->getID()."&type=document&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>"; if ($deleteaction) print "<a href='../op/op.ManageNotify.php?id=".$doc->getID()."&type=document&action=del' class=\"btn btn-mini\"><i class=\"icon-remove\"></i> ".getMLText("delete")."</a>";
else print "<a href='../out/out.DocumentNotify.php?documentid=".$doc->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>"; else print "<a href='../out/out.DocumentNotify.php?documentid=".$doc->getID()."' class=\"btn btn-mini\">".getMLText("edit")."</a>";
print "</td></tr>\n"; print "</td>\n";
echo $this->documentListRowEnd($doc);
} }
} }
print "</tbody></table>"; print "</tbody></table>";
@ -144,6 +135,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
$this->printFolderChooserJs("form1"); $this->printFolderChooserJs("form1");
$this->printDocumentChooserJs("form2"); $this->printDocumentChooserJs("form2");
$this->printClickDocumentJs();
$this->printClickFolderJs();
} /* }}} */ } /* }}} */
function show() { /* {{{ */ function show() { /* {{{ */
@ -211,28 +204,20 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
echo "<div class=\"row-fluid\">"; echo "<div class=\"row-fluid\">";
echo "<div class=\"span6\">"; echo "<div class=\"span6\">";
$this->contentHeading(getMLText("user")); $this->contentHeading(getMLText("user"));
$this->contentContainerStart();
$ret=$this->getNotificationList(false,true); $ret=$this->getNotificationList(false,true);
$this->printFolderNotificationList($ret); $this->printFolderNotificationList($ret);
$this->contentContainerEnd();
$this->contentHeading(getMLText("group")); $this->contentHeading(getMLText("group"));
$this->contentContainerStart();
$ret=$this->getNotificationList(true,true); $ret=$this->getNotificationList(true,true);
$this->printFolderNotificationList($ret,false); $this->printFolderNotificationList($ret,false);
$this->contentContainerEnd();
echo "</div>"; echo "</div>";
echo "<div class=\"span6\">"; echo "<div class=\"span6\">";
$this->contentHeading(getMLText("user")); $this->contentHeading(getMLText("user"));
$this->contentContainerStart();
$ret=$this->getNotificationList(false,false); $ret=$this->getNotificationList(false,false);
$this->printDocumentNotificationList($ret); $this->printDocumentNotificationList($ret);
$this->contentContainerEnd();
$this->contentHeading(getMLText("group")); $this->contentHeading(getMLText("group"));
$this->contentContainerStart();
$ret=$this->getNotificationList(true,false); $ret=$this->getNotificationList(true,false);
$this->printDocumentNotificationList($ret,false); $this->printDocumentNotificationList($ret,false);
$this->contentContainerEnd();
echo "</div>"; echo "</div>";
echo "</div>"; echo "</div>";
@ -240,4 +225,3 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */
} }
?>