From d5ce0f8fe9d334d4f90e7e2d3debb1a9482282d2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 09:11:15 +0100 Subject: [PATCH 1/7] hook folderListItem has new parameter --- views/bootstrap/class.ViewFolder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php index 669d73ba9..61492e27c 100644 --- a/views/bootstrap/class.ViewFolder.php +++ b/views/bootstrap/class.ViewFolder.php @@ -359,7 +359,7 @@ $('body').on('click', '.order-btn', function(ev) { foreach($subFolders as $subFolder) { if(!$maxItemsPerPage || $i < $maxItemsPerPage) { - $txt = $this->callHook('folderListItem', $subFolder, 'viewfolder'); + $txt = $this->callHook('folderListItem', $subFolder, false, 'viewfolder'); if(is_string($txt)) echo $txt; else { @@ -467,7 +467,7 @@ $('body').on('click', '.order-btn', function(ev) { $j = 0; // counts only returned entries foreach($subFolders as $subFolder) { if($i >= $offset && $j < $limit) { - $txt = $this->callHook('folderListItem', $subFolder, 'viewfolder'); + $txt = $this->callHook('folderListItem', $subFolder, false, 'viewfolder'); if(is_string($txt)) $content .= $txt; else { From 3e98a18babfbfca34d77ff44de5c0e0a51d213bb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 09:11:45 +0100 Subject: [PATCH 2/7] add new optional parameter skipcont to folderListRow() --- views/bootstrap/class.Bootstrap.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index f02c47688..3152517b5 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2475,7 +2475,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) return "\n"; } /* }}} */ - function folderListRow($subFolder, $extracontent=array()) { /* {{{ */ + function folderListRow($subFolder, $skipcont=false, $extracontent=array()) { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; // $folder = $this->params['folder']; @@ -2490,7 +2490,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) if (strlen($comment) > 150) $comment = substr($comment, 0, 147) . "..."; $content = ''; - $content .= $this->folderListRowStart($subFolder); + if(!$skipcont) + $content .= $this->folderListRowStart($subFolder); $content .= "getID()."&showtree=".$showtree."\">getMimeIcon(".folder")."\" width=\"24\" height=\"24\" border=0>\n"; if($onepage) $content .= "" . "getId()."\">".htmlspecialchars($subFolder->getName()).""; @@ -2551,7 +2552,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) } $content .= ""; $content .= ""; - $content .= $this->folderListRowEnd($subFolder); + if(!$skipcont) + $content .= $this->folderListRowEnd($subFolder); return $content; } /* }}} */ From 09f5943eb008fb9ea221e930f2ee18086104b248 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 09:12:25 +0100 Subject: [PATCH 3/7] pass new parameter $skipcont to folderListRow() --- views/bootstrap/class.Search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 0df46af47..0b64409b7 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -558,7 +558,7 @@ class SeedDMS_View_Search extends SeedDMS_Bootstrap_Style { $extracontent = array(); if($attrstr) $extracontent['bottom_title'] = '
'.$this->printPopupBox(''.getMLText('attributes').'', $attrstr, true); - print $this->folderListRow($folder, $extracontent); + print $this->folderListRow($folder, false, $extracontent); } } print "\n"; From 49bebebdae0132c36d5b481e8fa9211486c22b67 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 09:12:45 +0100 Subject: [PATCH 4/7] overhaul ManageNotify, support onepage mode, use standard output for documents and folders --- out/out.ManageNotify.php | 1 + views/bootstrap/class.ManageNotify.php | 62 ++++++++++---------------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/out/out.ManageNotify.php b/out/out.ManageNotify.php index bd204b655..a641d338c 100644 --- a/out/out.ManageNotify.php +++ b/out/out.ManageNotify.php @@ -38,6 +38,7 @@ if($view) { $view->setParam('cachedir', $settings->_cacheDir); $view->setParam('previewWidthList', $settings->_previewWidthList); $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($_GET); exit; diff --git a/views/bootstrap/class.ManageNotify.php b/views/bootstrap/class.ManageNotify.php index a93f0a7ea..2416a1706 100644 --- a/views/bootstrap/class.ManageNotify.php +++ b/views/bootstrap/class.ManageNotify.php @@ -64,7 +64,7 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { } else { - print ""; + print "
"; print "\n"; print "\n"; print "\n"; @@ -74,15 +74,18 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { foreach($notifications as $notification) { $fld = $this->dms->getFolder($notification->getTarget()); if (is_object($fld)) { - $owner = $fld->getOwner(); - print ""; - print ""; - print "\n"; - print ""; + echo $this->folderListRowStart($fld); + $txt = $this->callHook('folderListItem', $fld, true, 'viewfolder'); + if(is_string($txt)) + echo $txt; + else { + echo $this->folderListRow($fld, true); + } print ""; + print ""; + echo $this->folderListRowEnd($fld); } } print "
".getMLText("name")."
getID()."\">" . htmlspecialchars($fld->getName()) . "".htmlspecialchars($owner->getFullName()).""; if ($deleteaction) print " ".getMLText("delete").""; else print "".getMLText("edit").""; - print "
"; @@ -97,42 +100,30 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { else { $previewer = new SeedDMS_Preview_Previewer($this->cachedir, $this->previewwidth, $this->timeout, $this->xsendfile); - print ""; + print "
"; print "\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; + print "\n"; print "\n\n"; foreach ($notifications as $notification) { $doc = $this->dms->getDocument($notification->getTarget()); if (is_object($doc)) { - $owner = $doc->getOwner(); - $latest = $doc->getLatestContent(); - $status = $latest->getStatus(); - $previewer->createPreview($latest); - print "\n"; - print ""; - - print "\n"; - - print ""; print "\n"; + print "\n"; + echo $this->documentListRowEnd($doc); } } print "
".getMLText("name")."".getMLText("status")."".getMLText("action")."
"; - if($previewer->hasPreview($latest)) { - print "previewwidth."\" src=\"../op/op.Preview.php?documentid=".$doc->getID()."&version=".$latest->getVersion()."&width=".$this->previewwidth."\" title=\"".htmlspecialchars($latest->getMimeType())."\">"; - } else { - print "previewwidth."\" src=\"".$this->getMimeIcon($latest->getFileType())."\" title=\"".htmlspecialchars($latest->getMimeType())."\">"; + $doc->verifyLastestContentExpriry(); + echo $this->documentListRowStart($doc); + $txt = $this->callHook('documentListItem', $doc, $previewer, true, 'managenotify'); + if(is_string($txt)) + echo $txt; + else { + echo $this->documentListRow($doc, $previewer, true); } - print "getID()."\">" . htmlspecialchars($doc->getName()) . ""; - print "
".getMLText('owner').": ".htmlspecialchars($owner->getFullName()).", ".getMLText('creation_date').": ".date('Y-m-d', $doc->getDate()).", ".getMLText('version')." ".$latest->getVersion()." - ".date('Y-m-d', $latest->getDate()).""; - $comment = $latest->getComment(); - if($comment) { - print "
".htmlspecialchars($comment).""; - } - print "
".getOverallStatusText($status["status"]).""; if ($deleteaction) print " ".getMLText("delete").""; else print "".getMLText("edit").""; - print "
"; @@ -144,6 +135,8 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { $this->printFolderChooserJs("form1"); $this->printDocumentChooserJs("form2"); + $this->printClickDocumentJs(); + $this->printClickFolderJs(); } /* }}} */ function show() { /* {{{ */ @@ -211,28 +204,20 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { echo "
"; echo "
"; $this->contentHeading(getMLText("user")); - $this->contentContainerStart(); $ret=$this->getNotificationList(false,true); $this->printFolderNotificationList($ret); - $this->contentContainerEnd(); $this->contentHeading(getMLText("group")); - $this->contentContainerStart(); $ret=$this->getNotificationList(true,true); $this->printFolderNotificationList($ret,false); - $this->contentContainerEnd(); echo "
"; echo "
"; $this->contentHeading(getMLText("user")); - $this->contentContainerStart(); $ret=$this->getNotificationList(false,false); $this->printDocumentNotificationList($ret); - $this->contentContainerEnd(); $this->contentHeading(getMLText("group")); - $this->contentContainerStart(); $ret=$this->getNotificationList(true,false); $this->printDocumentNotificationList($ret,false); - $this->contentContainerEnd(); echo "
"; echo "
"; @@ -240,4 +225,3 @@ class SeedDMS_View_ManageNotify extends SeedDMS_Bootstrap_Style { $this->htmlEndPage(); } /* }}} */ } -?> From db3f38060465a448f99659694ba7cd9a4166a770 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 09:13:30 +0100 Subject: [PATCH 5/7] add changes for 5.1.16 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index cd62b667f..227aad6c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,8 @@ Changes in version 5.1.16 -------------------------------------------------------------------------------- - 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 From c021e4b4cb3aacbcc4496eb5170a192d2ac18501 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 22:26:53 +0100 Subject: [PATCH 6/7] make printPopupBox() public --- views/bootstrap/class.Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 3152517b5..b343d35cc 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2935,7 +2935,7 @@ $(document).ready(function() { $this->printTimelineHtml($height); } /* }}} */ - protected function printPopupBox($title, $content, $ret=false) { /* {{{ */ + public function printPopupBox($title, $content, $ret=false) { /* {{{ */ $id = md5(uniqid()); /* $this->addFooterJS(' From ee8081b3c1c59e3dfbeaf3e676c5f8d4eb6b39a5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 5 Mar 2020 22:27:11 +0100 Subject: [PATCH 7/7] set z-index of popupbox --- styles/bootstrap/application.css | 1 + 1 file changed, 1 insertion(+) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index 8ae479df4..63b7e5651 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -213,6 +213,7 @@ div.popupbox { display: none; position: absolute; min-width: 230px; + z-index: 10; } div.popupbox span.closepopupbox {