Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-03-10 14:32:18 +01:00
commit 3b4cecabcc
7 changed files with 35 additions and 45 deletions

View File

@ -134,6 +134,8 @@
Changes in version 5.1.16 Changes in version 5.1.16
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
- initialize categories to empty array. Closes #458 - initialize categories to empty array. Closes #458
- add new parameter $skipcont to hook folderListitem()
- use standard output format for documents and folders on ManageNotify page
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 5.1.15 Changes in version 5.1.15

View File

@ -41,6 +41,7 @@ if($view) {
$view->setParam('previewconverters', $settings->_converters['preview']); $view->setParam('previewconverters', $settings->_converters['preview']);
$view->setParam('timeout', $settings->_cmdTimeout); $view->setParam('timeout', $settings->_cmdTimeout);
$view->setParam('accessobject', $accessop); $view->setParam('accessobject', $accessop);
$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

@ -281,6 +281,7 @@ div.popupbox {
display: none; display: none;
position: absolute; position: absolute;
min-width: 230px; min-width: 230px;
z-index: 10;
} }
div.popupbox dt { div.popupbox dt {

View File

@ -2688,7 +2688,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
return "</tr>\n"; return "</tr>\n";
} /* }}} */ } /* }}} */
function folderListRow($subFolder, $extracontent=array()) { /* {{{ */ function folderListRow($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */
$dms = $this->params['dms']; $dms = $this->params['dms'];
$user = $this->params['user']; $user = $this->params['user'];
// $folder = $this->params['folder']; // $folder = $this->params['folder'];
@ -2703,7 +2703,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "...";
$content = ''; $content = '';
$content .= $this->folderListRowStart($subFolder); if(!$skipcont)
$content .= $this->folderListRowStart($subFolder);
$content .= "<td><a draggable=\"false\" href=\"../out/out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\"><img draggable=\"false\" src=\"".$this->getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0></a></td>\n"; $content .= "<td><a draggable=\"false\" href=\"../out/out.ViewFolder.php?folderid=".$subFolder->getID()."&showtree=".$showtree."\"><img draggable=\"false\" src=\"".$this->getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0></a></td>\n";
if($onepage) if($onepage)
$content .= "<td style=\"cursor: pointer;\">" . "<b title=\"Id:".$subFolder->getId()."\">".htmlspecialchars($subFolder->getName())."</b>"; $content .= "<td style=\"cursor: pointer;\">" . "<b title=\"Id:".$subFolder->getId()."\">".htmlspecialchars($subFolder->getName())."</b>";
@ -2764,7 +2765,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
} }
$content .= "</div>"; $content .= "</div>";
$content .= "</td>"; $content .= "</td>";
$content .= $this->folderListRowEnd($subFolder); if(!$skipcont)
$content .= $this->folderListRowEnd($subFolder);
return $content; return $content;
} /* }}} */ } /* }}} */

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>";
@ -98,42 +101,30 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
$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);
$previewer->setConverters($this->previewconverters); $previewer->setConverters($this->previewconverters);
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>";
@ -145,6 +136,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() { /* {{{ */
@ -213,28 +206,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>";
@ -242,4 +227,3 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style {
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */
} }
?>

View File

@ -661,7 +661,7 @@ $(document).ready( function() {
$extracontent = array(); $extracontent = array();
if($attrstr) if($attrstr)
$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-default">'.getMLText('attributes').'</span>', $attrstr, true); $extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-default">'.getMLText('attributes').'</span>', $attrstr, true);
print $this->folderListRow($folder, $extracontent); print $this->folderListRow($folder, false, $extracontent);
} }
} }
print "</tbody></table>\n"; print "</tbody></table>\n";

View File

@ -359,7 +359,7 @@ $('body').on('click', '.order-btn', function(ev) {
foreach($subFolders as $subFolder) { foreach($subFolders as $subFolder) {
if(!$maxItemsPerPage || $i < $maxItemsPerPage) { if(!$maxItemsPerPage || $i < $maxItemsPerPage) {
$txt = $this->callHook('folderListItem', $subFolder, 'viewfolder'); $txt = $this->callHook('folderListItem', $subFolder, false, 'viewfolder');
if(is_string($txt)) if(is_string($txt))
echo $txt; echo $txt;
else { else {
@ -467,7 +467,7 @@ $('body').on('click', '.order-btn', function(ev) {
$j = 0; // counts only returned entries $j = 0; // counts only returned entries
foreach($subFolders as $subFolder) { foreach($subFolders as $subFolder) {
if($i >= $offset && $j < $limit) { if($i >= $offset && $j < $limit) {
$txt = $this->callHook('folderListItem', $subFolder, 'viewfolder'); $txt = $this->callHook('folderListItem', $subFolder, false, 'viewfolder');
if(is_string($txt)) if(is_string($txt))
$content .= $txt; $content .= $txt;
else { else {